Hi, patches attached.
From 3ca8b04b1675d0ae8691526d640584babcfa0acd Mon Sep 17 00:00:00 2001 From: Paul B Mahol <one...@gmail.com> Date: Fri, 10 Jun 2016 12:48:09 +0200 Subject: [PATCH 1/3] avutil: add 10-bit planar RGB with alpha
Signed-off-by: Paul B Mahol <one...@gmail.com> --- libavutil/pixdesc.c | 28 ++++++++++++++++++++++++++++ libavutil/pixfmt.h | 4 ++++ 2 files changed, 32 insertions(+) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 4136980..0dffa4d 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2060,6 +2060,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, }, + [AV_PIX_FMT_GBRAP10LE] = { + .name = "gbrap10le", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */ + { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */ + { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */ + { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | + AV_PIX_FMT_FLAG_ALPHA, + }, + [AV_PIX_FMT_GBRAP10BE] = { + .name = "gbrap10be", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */ + { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */ + { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */ + { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, + }, }; #if FF_API_PLUS1_MINUS1 FF_ENABLE_DEPRECATION_WARNINGS diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index bc0cf9e..0fc7848 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -300,6 +300,9 @@ enum AVPixelFormat { AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian + AV_PIX_FMT_GBRAP10BE, ///< planar GBR 4:4:4:4 40bpp, big-endian + AV_PIX_FMT_GBRAP10LE, ///< planar GBR 4:4:4:4 40bpp, little-endian + AV_PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; @@ -355,6 +358,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE) #define AV_PIX_FMT_GBRP14 AV_PIX_FMT_NE(GBRP14BE, GBRP14LE) #define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) +#define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) #define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) #define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) -- 2.5.0
From ca485a6c1fd8494c11e5b9859fdaf5e116d6245d Mon Sep 17 00:00:00 2001 From: Paul B Mahol <one...@gmail.com> Date: Fri, 10 Jun 2016 13:01:26 +0200 Subject: [PATCH 2/3] swscale: add input support for gbrap10 pixel format Signed-off-by: Paul B Mahol <one...@gmail.com> --- libswscale/input.c | 6 ++++++ libswscale/utils.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index eed0f49..14ab5ab 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -978,6 +978,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GBRP9LE: c->readChrPlanar = planar_rgb9le_to_uv; break; + case AV_PIX_FMT_GBRAP10LE: case AV_PIX_FMT_GBRP10LE: c->readChrPlanar = planar_rgb10le_to_uv; break; @@ -995,6 +996,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GBRP9BE: c->readChrPlanar = planar_rgb9be_to_uv; break; + case AV_PIX_FMT_GBRAP10BE: case AV_PIX_FMT_GBRP10BE: c->readChrPlanar = planar_rgb10be_to_uv; break; @@ -1258,6 +1260,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GBRP9LE: c->readLumPlanar = planar_rgb9le_to_y; break; + case AV_PIX_FMT_GBRAP10LE: + c->readAlpPlanar = planar_rgb10le_to_a; case AV_PIX_FMT_GBRP10LE: c->readLumPlanar = planar_rgb10le_to_y; break; @@ -1277,6 +1281,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_GBRP9BE: c->readLumPlanar = planar_rgb9be_to_y; break; + case AV_PIX_FMT_GBRAP10BE: + c->readAlpPlanar = planar_rgb10be_to_a; case AV_PIX_FMT_GBRP10BE: c->readLumPlanar = planar_rgb10be_to_y; break; diff --git a/libswscale/utils.c b/libswscale/utils.c index 63a8226..576d8f0 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -218,6 +218,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { [AV_PIX_FMT_GBRP9BE] = { 1, 1 }, [AV_PIX_FMT_GBRP10LE] = { 1, 1 }, [AV_PIX_FMT_GBRP10BE] = { 1, 1 }, + [AV_PIX_FMT_GBRAP10LE] = { 1, 0 }, + [AV_PIX_FMT_GBRAP10BE] = { 1, 0 }, [AV_PIX_FMT_GBRP12LE] = { 1, 1 }, [AV_PIX_FMT_GBRP12BE] = { 1, 1 }, [AV_PIX_FMT_GBRAP12LE] = { 1, 0 }, @@ -1099,6 +1101,9 @@ static enum AVPixelFormat alphaless_fmt(enum AVPixelFormat fmt) case AV_PIX_FMT_GBRAP: return AV_PIX_FMT_GBRP; + case AV_PIX_FMT_GBRAP10LE: return AV_PIX_FMT_GBRP10; + case AV_PIX_FMT_GBRAP10BE: return AV_PIX_FMT_GBRP10; + case AV_PIX_FMT_GBRAP12LE: return AV_PIX_FMT_GBRP12; case AV_PIX_FMT_GBRAP12BE: return AV_PIX_FMT_GBRP12; @@ -1370,6 +1375,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, srcFormat != AV_PIX_FMT_RGB4_BYTE && srcFormat != AV_PIX_FMT_BGR4_BYTE && srcFormat != AV_PIX_FMT_GBRP9BE && srcFormat != AV_PIX_FMT_GBRP9LE && srcFormat != AV_PIX_FMT_GBRP10BE && srcFormat != AV_PIX_FMT_GBRP10LE && + srcFormat != AV_PIX_FMT_GBRAP10BE && srcFormat != AV_PIX_FMT_GBRAP10LE && srcFormat != AV_PIX_FMT_GBRP12BE && srcFormat != AV_PIX_FMT_GBRP12LE && srcFormat != AV_PIX_FMT_GBRAP12BE && srcFormat != AV_PIX_FMT_GBRAP12LE && srcFormat != AV_PIX_FMT_GBRP14BE && srcFormat != AV_PIX_FMT_GBRP14LE && -- 2.5.0
From 31c0cee4133f5ab3078ba7d3331e99cb8e8c5b97 Mon Sep 17 00:00:00 2001 From: Paul B Mahol <one...@gmail.com> Date: Fri, 10 Jun 2016 13:04:29 +0200 Subject: [PATCH 3/3] avcodec/sheervideo: fix argx format support Signed-off-by: Paul B Mahol <one...@gmail.com> --- libavcodec/sheervideo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c index 7304548..bbbdb83 100644 --- a/libavcodec/sheervideo.c +++ b/libavcodec/sheervideo.c @@ -1990,7 +1990,7 @@ static void decode_argx(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb) dst_b[x] = get_bits(gb, 10); } } else { - int pred[4] = { 512, 512, 512, 0 }; + int pred[4] = { 512, 512, 512, 512 }; for (x = 0; x < avctx->width; x++) { int r, g, b, a; @@ -2463,7 +2463,7 @@ static int decode_frame(AVCodecContext *avctx, } break; case MKTAG('A', 'R', 'G', 'X'): - avctx->pix_fmt = AV_PIX_FMT_GBRAP12; + avctx->pix_fmt = AV_PIX_FMT_GBRAP10; s->decode_frame = decode_argx; if (s->format != format) { build_vlc(&s->vlc[0], l_r_rgbx, 1024); -- 2.5.0
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel