From: Dmitry Ilyin <[email protected]>

The HEVC decoder does not export per-block quantizers, while the H.264,
MPEG-2 and VP9 decoders do (AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS). This
series adds that for HEVC, so tools such as venc_data_dump, the qp filter
and no-reference quality estimators can see the per-CU QP that adaptive
quantization (e.g. x265 AQ / cutree) produces; the slice QP alone can be
several units off.

Patch 1 adds AV_VIDEO_ENC_PARAMS_HEVC instead of reusing the H.264 type,
since the export granularity (minimum coding blocks) and chroma offsets
differ. Patch 2 exports one block per minimum coding block from qp_y_tab.
The side data is created at frame start and filled at frame end, so frames
queued for output before decoding finishes share the same buffer and carry
the QPs too. Patch 3 adds a FATE test on DELTAQP_C_SONY_3.bit (first frame);
all delta-QP conformance streams are 832x480 or larger, hence the size of
the reference file.

Tested: fate-hevc passes with and without THREADS=4 THREAD_TYPE=frame,
fate-{h264,vp9,hevc}-encparams pass, and the exported QPs were checked
against StreamEye's per-frame QP on fixed-QP x265 streams and against an
independent export on 252 x265 encodes (identical).

Dmitry Ilyin (3):
  avutil/video_enc_params: add AV_VIDEO_ENC_PARAMS_HEVC
  avcodec/hevc: export per-CU QP as video encoding parameters
  fate/hevc: add a test for exported video encoding parameters

 doc/APIchanges                |    3 +
 libavcodec/hevc/hevcdec.c     |   58 +
 libavutil/version.h           |    2 +-
 libavutil/video_enc_params.h  |   12 +
 tests/fate/hevc.mak           |    4 +
 tests/ref/fate/hevc-encparams | 6244 +++++++++++++++++++++++++++++++++
 6 files changed, 6322 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/fate/hevc-encparams

-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to