mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
showinfo: fix computation of Adler checksum
Previously the code was computing the checksum only for the first line of each plane.
This commit is contained in:
parent
10931720cd
commit
bb82ea797f
@ -43,13 +43,19 @@ static void end_frame(AVFilterLink *inlink)
|
|||||||
AVFilterContext *ctx = inlink->dst;
|
AVFilterContext *ctx = inlink->dst;
|
||||||
ShowInfoContext *showinfo = ctx->priv;
|
ShowInfoContext *showinfo = ctx->priv;
|
||||||
AVFilterBufferRef *picref = inlink->cur_buf;
|
AVFilterBufferRef *picref = inlink->cur_buf;
|
||||||
uint32_t plane_crc[4], crc = 0;
|
uint32_t plane_crc[4] = {0}, crc = 0;
|
||||||
int plane;
|
int i, plane, vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h;
|
||||||
|
|
||||||
for (plane = 0; plane < 4; plane++) {
|
for (plane = 0; picref->data[plane] && plane < 4; plane++) {
|
||||||
size_t linesize = av_image_get_linesize(picref->format, picref->video->w, plane);
|
size_t linesize = av_image_get_linesize(picref->format, picref->video->w, plane);
|
||||||
plane_crc[plane] = av_adler32_update(0 , picref->data[plane], linesize);
|
uint8_t *data = picref->data[plane];
|
||||||
crc = av_adler32_update(crc, picref->data[plane], linesize);
|
int h = plane == 1 || plane == 2 ? inlink->h >> vsub : inlink->h;
|
||||||
|
|
||||||
|
for (i = 0; i < h; i++) {
|
||||||
|
plane_crc[plane] = av_adler32_update(plane_crc[plane], data, linesize);
|
||||||
|
crc = av_adler32_update(crc, data, linesize);
|
||||||
|
data += picref->linesize[plane];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
av_log(ctx, AV_LOG_INFO,
|
av_log(ctx, AV_LOG_INFO,
|
||||||
|
Loading…
Reference in New Issue
Block a user