[FFmpeg-cvslog] pixdesc: add limited|full aliases for -color_range parameter

Chema Gonzalez git at videolan.org
Sat Sep 23 17:58:23 EEST 2023


ffmpeg | branch: master | Chema Gonzalez <chemag at gmail.com> | Fri Mar 31 08:49:56 2023 -0700| [984d0b6e6f40752cd00a2474bc1198d1a9e9e923] | committer: Niklas Haas

pixdesc: add limited|full aliases for -color_range parameter

Aliases are also used in scale and zscale filters.

Tested:
```
$ ./ffmpeg -hide_banner -y -i ~/src/media/images/y4m/lena.490x490.y4m  -pix_fmt yuv420p -color_range unknown /tmp/unknown.y4m
...
$ md5sum /tmp/unknown.y4m
69aa7bf52bbd72444268a544c81d7643  /tmp/unknown.y4m

$ ./ffmpeg -hide_banner -y -i ~/src/media/images/y4m/lena.490x490.y4m  -pix_fmt yuv420p -color_range tv /tmp/tv.y4m
...
$ md5sum /tmp/tv.y4m
5c1c8759708ff6b25dd8a660da5200e7  /tmp/tv.y4m

$ ./ffmpeg -hide_banner -y -i ~/src/media/images/y4m/lena.490x490.y4m  -pix_fmt yuv420p -color_range pc /tmp/pc.y4m
...
$ md5sum /tmp/pc.y4m
1ccb85d14a3dfecb22e625711587ba97  /tmp/pc.y4m

$ ./ffmpeg -hide_banner -y -i ~/src/media/images/y4m/lena.490x490.y4m  -pix_fmt yuv420p -color_range limited /tmp/limited.y4m
...
$ md5sum /tmp/limited.y4m
5c1c8759708ff6b25dd8a660da5200e7  /tmp/limited.y4m

$ ./ffmpeg -hide_banner -y -i ~/src/media/images/y4m/lena.490x490.y4m  -pix_fmt yuv420p -color_range full /tmp/full.y4m
...
$ md5sum /tmp/full.y4m
1ccb85d14a3dfecb22e625711587ba97  /tmp/full.y4m
```

Also ran fate.
```
$ make fate -j
...
TEST    ffprobe_xsd
TEST    flv-add_keyframe_index
```

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=984d0b6e6f40752cd00a2474bc1198d1a9e9e923
---

 doc/codecs.texi            | 2 ++
 libavcodec/options_table.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/doc/codecs.texi b/doc/codecs.texi
index f903dad754..a155939606 100644
--- a/doc/codecs.texi
+++ b/doc/codecs.texi
@@ -889,9 +889,11 @@ Possible values:
 @table @samp
 @item tv
 @item mpeg
+ at item limited
 MPEG (219*2^(n-8))
 @item pc
 @item jpeg
+ at item full
 JPEG (2^n-1)
 @end table
 
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 47e4a313bc..f2155232cf 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -350,6 +350,8 @@ static const AVOption avcodec_options[] = {
 {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_range_type"},
 {"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG },        INT_MIN, INT_MAX, V|E|D, "color_range_type"},
 {"jpeg", "JPEG (2^n-1)",       0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG },        INT_MIN, INT_MAX, V|E|D, "color_range_type"},
+{"limited", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG },     INT_MIN, INT_MAX, V|E|D, "color_range_type"},
+{"full", "JPEG (2^n-1)",       0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG },        INT_MIN, INT_MAX, V|E|D, "color_range_type"},
 {"chroma_sample_location", "chroma sample location", OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, 0, INT_MAX, V|E|D, "chroma_sample_location_type"},
 {"unknown",     "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"},
 {"left",        "Left",        0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_LEFT },        INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"},



More information about the ffmpeg-cvslog mailing list