[FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

Mark Thompson sw at jkqxz.net
Tue Aug 8 01:46:18 EEST 2017

On 07/08/17 23:03, Jorge Ramirez wrote:
> On 08/07/2017 11:55 PM, Mark Thompson wrote:
>>> would you know where can I get this information from (qmin/qmx for the other encoders)?
>>  From the relevant language standards.
>> H.263 / MPEG-4 part 2:  [1, 31]  (<https://www.itu.int/rec/T-REC-H.263>: PQUANT, GQUANT.)
>> H.264 / MPEG-4 part 10 / AVC:  [48 - 6 * bitdepth, 51]  (<https://www.itu.int/rec/T-REC-H.264>: QpBdOffsety, pic_init_qp_minus26, slice_qp_delta.)
>> H.265 / MPEG-H part 2 / HEVC:  [48 - 6 * bitdepth, 51]  (<https://www.itu.int/rec/T-REC-H.265>: QpBdOffsety, init_qp_minus26, slice_qp_delta.)

(Possibly relevant: many implementations normalise these to be nonnegative on the user side rather than using the standard values, making them [0, 3 + bitdepth * 6].  If you have 10-bit video then you should check what range the codecs actually use here.)

>> VP8:  [0, 127]  (<https://tools.ietf.org/html/rfc6386>: q_index.)
>> VP9:  [0, 255]  (<https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp9-bitstream-specification-v0.6-20160331-draft.pdf>: base_q_idx.)
> ah thanks a lot.
> btw, how come that that this information is not already present in some ffmpeg table?

Most files only deal with one codec.  It's only when you've delegated almost everything to somewhere else that you run into the problem of all of these together :)

> Just trying to decide if I should just import the relevant data into the v4l2_m2m_enc file or somewhere else?
Put them in the v4l2_m2m_enc file, I think.  How you want do that probably depends on how V4L2 acts without the options: if it acts sensibly when you don't pass them, then make a defaults table with sentinel values and don't pass anything if you see them (so they are only passed to the codec if the user sets them manually).  If they are required, then you'll need to make a defaults table for each codec with the correct values in.

More information about the ffmpeg-devel mailing list