Skip to content

Commit c94a419

Browse files
Timotheergdmichaelni
authored andcommitted
avfilter/codecview: Enable QP visualization for H.264
The codecviewfilter, when used with qp=1, did not display quantization parameter values for H.264 streams because the QP table extraction was restricted to MPEG-2 video. This patch enables H.264 support by updating ff_qp_table_extractto accept AV_VIDEO_ENC_PARAMS_H264. This allows for correct QP overlay on H.264 video Signed-off-by: Timothee <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
1 parent e6298e0 commit c94a419

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libavfilter/qp_table.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table
3939
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_ENC_PARAMS);
4040
if (!sd)
4141
return 0;
42-
par = (AVVideoEncParams*)sd->data;
43-
if (par->type != AV_VIDEO_ENC_PARAMS_MPEG2 ||
42+
par = (AVVideoEncParams *)sd->data;
43+
if ((par->type != AV_VIDEO_ENC_PARAMS_MPEG2 &&
44+
par->type != AV_VIDEO_ENC_PARAMS_H264) ||
4445
(par->nb_blocks != 0 && par->nb_blocks != nb_mb))
4546
return AVERROR(ENOSYS);
4647

0 commit comments

Comments
 (0)