mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Untabified encmain.c and nal.c
This commit is contained in:
parent
a7dade5069
commit
a935aa5d96
|
@ -277,7 +277,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Remove the ref pic (if present)
|
// Remove the ref pic (if present)
|
||||||
if (encoder->ref->used_size == encoder->cfg->ref_frames) {
|
if (encoder->ref->used_size == encoder->cfg->ref_frames) {
|
||||||
picture_list_rem(encoder->ref, encoder->ref->used_size-1, 1);
|
picture_list_rem(encoder->ref, encoder->ref->used_size-1, 1);
|
||||||
}
|
}
|
||||||
// Add current picture as reference
|
// Add current picture as reference
|
||||||
picture_list_add(encoder->ref, encoder->in.cur_pic);
|
picture_list_add(encoder->ref, encoder->in.cur_pic);
|
||||||
|
|
32
src/nal.c
32
src/nal.c
|
@ -108,24 +108,24 @@ static void array_checksum(const pixel* data,
|
||||||
const int stride,
|
const int stride,
|
||||||
unsigned char checksum_out[SEI_HASH_MAX_LENGTH])
|
unsigned char checksum_out[SEI_HASH_MAX_LENGTH])
|
||||||
{
|
{
|
||||||
uint8_t mask;
|
uint8_t mask;
|
||||||
uint32_t checksum = 0;
|
uint32_t checksum = 0;
|
||||||
int y, x;
|
int y, x;
|
||||||
|
|
||||||
assert(SEI_HASH_MAX_LENGTH >= 4);
|
assert(SEI_HASH_MAX_LENGTH >= 4);
|
||||||
|
|
||||||
for (y = 0; y < height; ++y) {
|
for (y = 0; y < height; ++y) {
|
||||||
for (x = 0; x < width; ++x) {
|
for (x = 0; x < width; ++x) {
|
||||||
mask = (uint8_t)((x & 0xff) ^ (y & 0xff) ^ (x >> 8) ^ (y >> 8));
|
mask = (uint8_t)((x & 0xff) ^ (y & 0xff) ^ (x >> 8) ^ (y >> 8));
|
||||||
checksum += (data[(y * stride) + x] & 0xff) ^ mask;
|
checksum += (data[(y * stride) + x] & 0xff) ^ mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unpack uint into byte-array.
|
// Unpack uint into byte-array.
|
||||||
checksum_out[0] = (checksum >> 24) & 0xff;
|
checksum_out[0] = (checksum >> 24) & 0xff;
|
||||||
checksum_out[1] = (checksum >> 16) & 0xff;
|
checksum_out[1] = (checksum >> 16) & 0xff;
|
||||||
checksum_out[2] = (checksum >> 8) & 0xff;
|
checksum_out[2] = (checksum >> 8) & 0xff;
|
||||||
checksum_out[3] = (checksum) & 0xff;
|
checksum_out[3] = (checksum) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -137,9 +137,9 @@ static void array_checksum(const pixel* data,
|
||||||
*/
|
*/
|
||||||
void picture_checksum(const picture* pic, unsigned char checksum_out[][SEI_HASH_MAX_LENGTH])
|
void picture_checksum(const picture* pic, unsigned char checksum_out[][SEI_HASH_MAX_LENGTH])
|
||||||
{
|
{
|
||||||
array_checksum(pic->y_recdata, pic->height, pic->width, pic->width, checksum_out[0]);
|
array_checksum(pic->y_recdata, pic->height, pic->width, pic->width, checksum_out[0]);
|
||||||
|
|
||||||
/* The number of chroma pixels is half that of luma. */
|
/* The number of chroma pixels is half that of luma. */
|
||||||
array_checksum(pic->u_recdata, pic->height >> 1, pic->width >> 1, pic->width >> 1, checksum_out[1]);
|
array_checksum(pic->u_recdata, pic->height >> 1, pic->width >> 1, pic->width >> 1, checksum_out[1]);
|
||||||
array_checksum(pic->v_recdata, pic->height >> 1, pic->width >> 1, pic->width >> 1, checksum_out[2]);
|
array_checksum(pic->v_recdata, pic->height >> 1, pic->width >> 1, pic->width >> 1, checksum_out[2]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue