> +static int pix2color_fmt(AVCodecContext *avctx, enum AVPixelFormat pix_fmt)
> +{
> + for (int i = 0; i < FF_ARRAY_ELEMS(color_formats); i++) {
> + if (pix_fmt == color_formats[i].pix_fmt) {
> + return color_formats[i].color_format;
> + }
> + }
> + av_assert0(0);
> +}
After extracting to a general function, there is no hint that pix_fmt comes
from avctx->pix_fmt. So I prefer return error code here.
> +
> +static enum AVPixelFormat color2pix_fmt(AVCodecContext *avctx, int
> color_format)
> +{
> + for (int i = 0; i < FF_ARRAY_ELEMS(color_formats); i++) {
> + if (color_format == color_formats[i].color_format) {
> + return color_formats[i].pix_fmt;
> + }
> + }
> + av_assert0(0);
> +}
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".