[FFmpeg-devel] [PATCH] libvpx: Support setting color range for vp9.

Sasi Inguva isasi at google.com
Wed Dec 30 21:46:52 CET 2015


VPX_IMAGE_ABI_VERSION was not changed when the color_range enum was
introduced so I am afraid I would have to drop libvpxdec changes.
Sent the new patch

On Wed, Dec 30, 2015 at 10:56 AM, James Almer <jamrial at gmail.com> wrote:

> On 12/30/2015 3:47 PM, James Almer wrote:
> > On 12/30/2015 3:23 PM, Sasi Inguva wrote:
> >> Pass through color range to vp9 encoder, and parse it in libvpxdec
> >>
> >> Signed-off-by: Sasi Inguva <isasi at google.com>
> >> ---
> >>  libavcodec/libvpxdec.c |  4 ++++
> >>  libavcodec/libvpxenc.c | 20 ++++++++++++++++++++
> >>  2 files changed, 24 insertions(+)
> >>
> >> diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
> >> index 7267590..169a137 100644
> >> --- a/libavcodec/libvpxdec.c
> >> +++ b/libavcodec/libvpxdec.c
> >> @@ -68,6 +68,10 @@ static int set_pix_fmt(AVCodecContext *avctx, struct
> vpx_image *img)
> >>          AVCOL_SPC_SMPTE240M, AVCOL_SPC_BT2020_NCL, AVCOL_SPC_RESERVED,
> AVCOL_SPC_RGB,
> >>      };
> >>      avctx->colorspace = colorspaces[img->cs];
> >> +    static const enum AVColorRange color_ranges[8] = {
> >
> > Mixed declarations and code. Also, shouldn't it be [2]?
> >
>
> This also fails with libvpx 1.4.0. The VPX_ENCODER_ABI_VERSION check is
> not enough.
>
>
> CC libavcodec/libvpxdec.o
> CC libavcodec/libvpxenc.o
> /ffmpeg/src/libavcodec/libvpxdec.c: In function 'set_pix_fmt':
> /ffmpeg/src/libavcodec/libvpxdec.c:71:5: warning: ISO C90 forbids mixed
> declarations and code [-Wdeclaration-after-statement]
> static const enum AVColorRange color_ranges[8] = {
> ^
> /ffmpeg/src/libavcodec/libvpxdec.c:74:42: error: 'struct vpx_image' has no
> member named 'range'
> avctx->color_range = color_ranges[img->range];
> ^
> /ffmpeg/src/libavcodec/libvpxdec.c:71:36: warning: variable 'color_ranges'
> set but not used [-Wunused-but-set-variable]
> static const enum AVColorRange color_ranges[8] = {
> ^
> /ffmpeg/src/libavcodec/libvpxenc.c:126:6: error: 'VP9E_SET_COLOR_RANGE'
> undeclared here (not in a function)
> [VP9E_SET_COLOR_RANGE] = "VP9E_SET_COLOR_RANGE",
> ^
> /ffmpeg/src/libavcodec/libvpxenc.c:126:6: error: array index in
> initializer not of integer type
> /ffmpeg/src/libavcodec/libvpxenc.c:126:6: note: (near initialization for
> 'ctlidstr')
> /ffmpeg/src/libavcodec/libvpxenc.c: In function 'set_color_range':
> /ffmpeg/src/libavcodec/libvpxenc.c:373:26: error: storage size of 'vpx_cr'
> isn't known
> enum vpx_color_range vpx_cr;
> ^
> /ffmpeg/src/libavcodec/libvpxenc.c:377:18: error: 'VPX_CR_STUDIO_RANGE'
> undeclared (first use in this function)
> vpx_cr = VPX_CR_STUDIO_RANGE; break;
> ^
> /ffmpeg/src/libavcodec/libvpxenc.c:377:18: note: each undeclared
> identifier is reported only once for each function it appears in
> /ffmpeg/src/libavcodec/libvpxenc.c:379:18: error: 'VPX_CR_FULL_RANGE'
> undeclared (first use in this function)
> vpx_cr = VPX_CR_FULL_RANGE; break;
> ^
> /ffmpeg/src/libavcodec/libvpxenc.c:373:26: warning: unused variable
> 'vpx_cr' [-Wunused-variable]
> enum vpx_color_range vpx_cr;
> ^
> /ffmpeg/src/common.mak:60: recipe for target 'libavcodec/libvpxdec.o'
> failed
> make: *** [libavcodec/libvpxdec.o] Error 1
> make: *** Waiting for unfinished jobs....
> /ffmpeg/src/common.mak:60: recipe for target 'libavcodec/libvpxenc.o'
> failed
> make: *** [libavcodec/libvpxenc.o] Error 1
>


More information about the ffmpeg-devel mailing list