mbox series

[FFmpeg-devel,v0,00/14] encoder AVCodecContext configuration side data

Message ID 20230320233408.134255-1-jeebjp@gmail.com
Headers show
Series encoder AVCodecContext configuration side data | expand

Message

Jan Ekström March 20, 2023, 11:33 p.m. UTC
This patch set I've now been working for a while since I felt like it was weird
we couldn't pass through information such as static HDR metadata to encoders
from decoded input. This initial version adds the necessary framework, as well
as adds static HDR metadata support for libsvtav1, libx264 as well as libx265
wrappers.

The first patch, poking at loop counters, was already posted earlier separately,
and only part of this set in order to make the patch set applicable on top of
master, as the patch had not yet received any ACKs.

An alternative to this would be to make encoders only properly initialize when
they receive the first AVFrame, but that seems to be a bigger, nastier change
than introducing a private AVFrameSideDataSet in avctx as everything seems to
presume that extradata etc are available after opening the encoder.


Jan

Jan Ekström (14):
  avutil/frame: move counters utilized in loops to their scope
  avcodec: move AVCodecInternal allocation to avcodec_alloc_context3
  avutil/frame: add AVFrameSideDataSet for passing sets of side data
  avutil/frame: split side data list wiping out to non-AVFrame function
  avutil/frame: add helper for clearing out side data sets
  avutil/frame: split side_data_from_buf to base and AVFrame func
  avutil/frame: add helper for adding side data to set
  avutil/frame: add helper for getting side data from set
  avcodec: add private side data set to AVCodecInternal
  avcodec: add function for setting avctx side data
  ffmpeg: pass first video AVFrame's side data to encoder
  avcodec/libsvtav1: add support for writing out CLL and MDCV
  avcodec/libx264: add support for writing out CLL and MDCV
  avcodec/libx265: add support for writing out CLL and MDCV

 fftools/ffmpeg.c                  |  12 +++
 libavcodec/avcodec.c              |  49 +++++++--
 libavcodec/avcodec.h              |  12 +++
 libavcodec/frame_thread_encoder.c |   7 +-
 libavcodec/internal.h             |  12 +++
 libavcodec/libsvtav1.c            |  70 +++++++++++++
 libavcodec/libx264.c              |  79 +++++++++++++++
 libavcodec/libx265.c              |  82 +++++++++++++++
 libavcodec/options.c              |  25 ++++-
 libavutil/frame.c                 | 161 ++++++++++++++++++------------
 libavutil/frame.h                 |  38 +++++++
 11 files changed, 474 insertions(+), 73 deletions(-)