[FFmpeg-cvslog] Allow YUV444P and RGB/BGR encoding for libx264.
Stefano Sabatini
stefasab at gmail.com
Sun Oct 9 14:28:47 CEST 2011
On date Sunday 2011-10-09 05:58:29 +0200, Themaister wrote:
> ffmpeg | branch: master | Themaister <maister at archlinux.us> | Sat Oct 8 12:16:43 2011 +0200| [18a97b030c923579c694353f8529f05701b481e8] | committer: Michael Niedermayer
>
> Allow YUV444P and RGB/BGR encoding for libx264.
>
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
>
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=18a97b030c923579c694353f8529f05701b481e8
> ---
>
> libavcodec/libx264.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++--
> 1 files changed, 55 insertions(+), 3 deletions(-)
[...]
> +static int avfmt2_num_planes(int avfmt)
> +{
> + switch (avfmt) {
> + case PIX_FMT_YUV420P:
> + case PIX_FMT_YUVJ420P:
> + case PIX_FMT_YUV420P9:
> + case PIX_FMT_YUV420P10:
> + case PIX_FMT_YUV444P:
> + return 3;
> +
> + case PIX_FMT_BGR24:
> + case PIX_FMT_RGB24:
> + return 1;
> +
> + default:
> + return 3;
> + }
> +}
note: here you may use
nb_planes = 0;
for (i = 0; i < desc->nb_components; i++)
nb_planes = FFMAX(desc->comp[i].plane, nb_planes);
nb_planes++;
or we may add an inline av_get_nb_planes() in pixdesc.h.
More information about the ffmpeg-cvslog
mailing list