On Thu, Jun 14, 2018 at 12:03:13AM +0800, Wang Cao wrote:
> ---
> libavformat/yuv4mpegdec.c | 8 ++++++++
> libavformat/yuv4mpegenc.c | 37 +++++++++++++++++++++++++++++++++++--
> 2 files changed, 43 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c
> index eff7fc518e..86e8673b2f 100644
> --- a/libavformat/yuv4mpegdec.c
> +++ b/libavformat/yuv4mpegdec.c
> @@ -41,6 +41,7 @@ static int yuv4_read_header(AVFormatContext *s)
> enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE, alt_pix_fmt =
> AV_PIX_FMT_NONE;
> enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;
> enum AVFieldOrder field_order = AV_FIELD_UNKNOWN;
> + enum AVColorRange color_range = AVCOL_RANGE_UNSPECIFIED;
> AVStream *st;
>
> for (i = 0; i < MAX_YUV4_HEADER; i++) {
> @@ -220,6 +221,12 @@ static int yuv4_read_header(AVFormatContext *s)
> alt_pix_fmt = AV_PIX_FMT_YUV422P;
> else if (strncmp("444", tokstart, 3) == 0)
> alt_pix_fmt = AV_PIX_FMT_YUV444P;
> + } else if (strncmp("COLORRANGE=", tokstart, 11) == 0) {
> + tokstart += 11;
> + if (strncmp("JPEG",tokstart, 4) == 0)
> + color_range = AVCOL_RANGE_JPEG;
> + else if (strncmp("MPEG", tokstart, 4) == 0)
> + color_range = AVCOL_RANGE_MPEG;
> }If this is a type we are choosing then it would be probably better to use something else than mpeg/jpeg as names these are 2 standard comittees and their standards support more than one color range. maybe "full" and "limited" or some other terms may be better thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
