Jul 17, 2020, 02:12 by jamr...@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.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to