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

Mark Thompson sw at jkqxz.net
Tue Aug 8 00:55:21 EEST 2017



On 07/08/17 19:51, Jorge Ramirez wrote:
> On 08/04/2017 01:51 PM, Mark Thompson wrote:
>>> +        break;
>>> +    case AV_CODEC_ID_H263:
>>> +        qmin = MPEG_CID(H263_MIN_QP);
>>> +        qmax = MPEG_CID(H263_MAX_QP);
>>> +        break;
>>> +    case AV_CODEC_ID_VP8:
>>> +    case AV_CODEC_ID_VP9:
>>> +        qmin = MPEG_CID(VPX_MIN_QP);
>>> +        qmax = MPEG_CID(VPX_MAX_QP);
>>> +        break;
>>> +    default:
>>> +        return 0;
>>> +    }
>>> +
>>> +    SET_V4L_EXT_CTRL(value, qmin, avctx->qmin, "minimum video quantizer scale");
>>> +    SET_V4L_EXT_CTRL(value, qmax, avctx->qmax, "maximum video quantizer scale");
>> The default values of qmin/qmax in options_table.h are set for the MPEG-4 part 2 encoder, and will do nasty things to others.  (Certainly for VP9 (assuming it maps to qindex) it's a very low value, so it probably won't ever get anywhere near the bitrate target for normal video.  H.26[45] and VP8 also, but to a lesser degree.)
> 
> 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.)
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.)


- Mark


More information about the ffmpeg-devel mailing list