[FFmpeg-devel] [PATCH] libaomenc: enable 8, 10 and 12 bit RGB encoding

Lynne dev at lynne.ee
Fri Jul 17 23:19:32 EEST 2020


Jul 17, 2020, 02:12 by jamrial at gmail.com:

> On 7/16/2020 7:46 AM, Lynne wrote: 
>
>> -    codecctl_int(avctx, AV1E_SET_COLOR_PRIMARIES, avctx->color_primaries);
>> -    codecctl_int(avctx, AV1E_SET_MATRIX_COEFFICIENTS, avctx->colorspace);
>> -    codecctl_int(avctx, AV1E_SET_TRANSFER_CHARACTERISTICS, avctx->color_trc);
>> +    if (avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == AV_PIX_FMT_GBRP10 ||
>> +        avctx->pix_fmt == AV_PIX_FMT_GBRP12) {
>>
>
> It may be cleaner here and above if you instead use
> av_pix_fmt_desc_get() in the function then look at desc->comp[0]->depth
> for bitdepth and and desc->flags & AV_PIX_FMT_FLAG_RGB for RGB, instead
> of all these if checks for a dozen pixfmts.
>

I tried that but it didn't look cleaner. The pixdesc API is unfortunately necessarily cumbersome,
since 565 RGB formats exist, so we can't rely on all components having the same bit depth
to have a separate av_pix_fmt_get_depth(pixfmt) function.



> Should be ok either way.
>

Thanks for the review, pushed.
Might write a similar patch for the librav1e wrapper which has a similar problem.


More information about the ffmpeg-devel mailing list