Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Kieran Kunhya authored on 2016/02/09 06:40:10... | ... |
@@ -351,6 +351,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, |
351 | 351 |
case AV_PIX_FMT_GBRP14BE: |
352 | 352 |
case AV_PIX_FMT_GBRP16LE: |
353 | 353 |
case AV_PIX_FMT_GBRP16BE: |
354 |
+ case AV_PIX_FMT_GBRAP12LE: |
|
355 |
+ case AV_PIX_FMT_GBRAP12BE: |
|
354 | 356 |
case AV_PIX_FMT_GBRAP16LE: |
355 | 357 |
case AV_PIX_FMT_GBRAP16BE: |
356 | 358 |
w_align = 16; //FIXME assume 16 pixel per macroblock |
... | ... |
@@ -2028,6 +2028,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { |
2028 | 2028 |
}, |
2029 | 2029 |
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, |
2030 | 2030 |
}, |
2031 |
+ [AV_PIX_FMT_GBRAP12LE] = { |
|
2032 |
+ .name = "gbrap12le", |
|
2033 |
+ .nb_components = 4, |
|
2034 |
+ .log2_chroma_w = 0, |
|
2035 |
+ .log2_chroma_h = 0, |
|
2036 |
+ .comp = { |
|
2037 |
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */ |
|
2038 |
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */ |
|
2039 |
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */ |
|
2040 |
+ { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */ |
|
2041 |
+ }, |
|
2042 |
+ .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | |
|
2043 |
+ AV_PIX_FMT_FLAG_ALPHA, |
|
2044 |
+ }, |
|
2045 |
+ [AV_PIX_FMT_GBRAP12BE] = { |
|
2046 |
+ .name = "gbrap12be", |
|
2047 |
+ .nb_components = 4, |
|
2048 |
+ .log2_chroma_w = 0, |
|
2049 |
+ .log2_chroma_h = 0, |
|
2050 |
+ .comp = { |
|
2051 |
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */ |
|
2052 |
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */ |
|
2053 |
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */ |
|
2054 |
+ { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */ |
|
2055 |
+ }, |
|
2056 |
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | |
|
2057 |
+ AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, |
|
2058 |
+ }, |
|
2031 | 2059 |
}; |
2032 | 2060 |
#if FF_API_PLUS1_MINUS1 |
2033 | 2061 |
FF_ENABLE_DEPRECATION_WARNINGS |
... | ... |
@@ -292,6 +292,9 @@ enum AVPixelFormat { |
292 | 292 |
AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian |
293 | 293 |
AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian |
294 | 294 |
|
295 |
+ AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian |
|
296 |
+ AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian |
|
297 |
+ |
|
295 | 298 |
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 |
296 | 299 |
}; |
297 | 300 |
|
... | ... |
@@ -347,6 +350,7 @@ enum AVPixelFormat { |
347 | 347 |
#define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE) |
348 | 348 |
#define AV_PIX_FMT_GBRP14 AV_PIX_FMT_NE(GBRP14BE, GBRP14LE) |
349 | 349 |
#define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) |
350 |
+#define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) |
|
350 | 351 |
#define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) |
351 | 352 |
|
352 | 353 |
#define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) |
... | ... |
@@ -981,6 +981,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) |
981 | 981 |
case AV_PIX_FMT_GBRP10LE: |
982 | 982 |
c->readChrPlanar = planar_rgb10le_to_uv; |
983 | 983 |
break; |
984 |
+ case AV_PIX_FMT_GBRAP12LE: |
|
984 | 985 |
case AV_PIX_FMT_GBRP12LE: |
985 | 986 |
c->readChrPlanar = planar_rgb12le_to_uv; |
986 | 987 |
break; |
... | ... |
@@ -997,6 +998,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) |
997 | 997 |
case AV_PIX_FMT_GBRP10BE: |
998 | 998 |
c->readChrPlanar = planar_rgb10be_to_uv; |
999 | 999 |
break; |
1000 |
+ case AV_PIX_FMT_GBRAP12BE: |
|
1000 | 1001 |
case AV_PIX_FMT_GBRP12BE: |
1001 | 1002 |
c->readChrPlanar = planar_rgb12be_to_uv; |
1002 | 1003 |
break; |
... | ... |
@@ -1259,6 +1261,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) |
1259 | 1259 |
case AV_PIX_FMT_GBRP10LE: |
1260 | 1260 |
c->readLumPlanar = planar_rgb10le_to_y; |
1261 | 1261 |
break; |
1262 |
+ case AV_PIX_FMT_GBRAP12LE: |
|
1263 |
+ c->readAlpPlanar = planar_rgb12le_to_a; |
|
1262 | 1264 |
case AV_PIX_FMT_GBRP12LE: |
1263 | 1265 |
c->readLumPlanar = planar_rgb12le_to_y; |
1264 | 1266 |
break; |
... | ... |
@@ -1276,6 +1280,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) |
1276 | 1276 |
case AV_PIX_FMT_GBRP10BE: |
1277 | 1277 |
c->readLumPlanar = planar_rgb10be_to_y; |
1278 | 1278 |
break; |
1279 |
+ case AV_PIX_FMT_GBRAP12BE: |
|
1280 |
+ c->readAlpPlanar = planar_rgb12be_to_a; |
|
1279 | 1281 |
case AV_PIX_FMT_GBRP12BE: |
1280 | 1282 |
c->readLumPlanar = planar_rgb12be_to_y; |
1281 | 1283 |
break; |
... | ... |
@@ -1643,6 +1643,7 @@ void ff_get_unscaled_swscale(SwsContext *c) |
1643 | 1643 |
dstFormat == AV_PIX_FMT_GBRP12LE || dstFormat == AV_PIX_FMT_GBRP12BE || |
1644 | 1644 |
dstFormat == AV_PIX_FMT_GBRP14LE || dstFormat == AV_PIX_FMT_GBRP14BE || |
1645 | 1645 |
dstFormat == AV_PIX_FMT_GBRP16LE || dstFormat == AV_PIX_FMT_GBRP16BE || |
1646 |
+ dstFormat == AV_PIX_FMT_GBRAP12LE || dstFormat == AV_PIX_FMT_GBRAP12BE || |
|
1646 | 1647 |
dstFormat == AV_PIX_FMT_GBRAP16LE || dstFormat == AV_PIX_FMT_GBRAP16BE )) |
1647 | 1648 |
c->swscale = Rgb16ToPlanarRgb16Wrapper; |
1648 | 1649 |
|
... | ... |
@@ -1651,6 +1652,7 @@ void ff_get_unscaled_swscale(SwsContext *c) |
1651 | 1651 |
srcFormat == AV_PIX_FMT_GBRP10LE || srcFormat == AV_PIX_FMT_GBRP10BE || |
1652 | 1652 |
srcFormat == AV_PIX_FMT_GBRP12LE || srcFormat == AV_PIX_FMT_GBRP12BE || |
1653 | 1653 |
srcFormat == AV_PIX_FMT_GBRP14LE || srcFormat == AV_PIX_FMT_GBRP14BE || |
1654 |
+ srcFormat == AV_PIX_FMT_GBRAP12LE || srcFormat == AV_PIX_FMT_GBRAP12BE || |
|
1654 | 1655 |
srcFormat == AV_PIX_FMT_GBRAP16LE || srcFormat == AV_PIX_FMT_GBRAP16BE) && |
1655 | 1656 |
(dstFormat == AV_PIX_FMT_RGB48LE || dstFormat == AV_PIX_FMT_RGB48BE || |
1656 | 1657 |
dstFormat == AV_PIX_FMT_BGR48LE || dstFormat == AV_PIX_FMT_BGR48BE || |
... | ... |
@@ -1692,6 +1694,7 @@ void ff_get_unscaled_swscale(SwsContext *c) |
1692 | 1692 |
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP12) || |
1693 | 1693 |
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP14) || |
1694 | 1694 |
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP16) || |
1695 |
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRAP12) || |
|
1695 | 1696 |
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRAP16) || |
1696 | 1697 |
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB444) || |
1697 | 1698 |
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB48) || |
... | ... |
@@ -206,6 +206,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { |
206 | 206 |
[AV_PIX_FMT_GBRP10BE] = { 1, 1 }, |
207 | 207 |
[AV_PIX_FMT_GBRP12LE] = { 1, 1 }, |
208 | 208 |
[AV_PIX_FMT_GBRP12BE] = { 1, 1 }, |
209 |
+ [AV_PIX_FMT_GBRAP12LE] = { 1, 0 }, |
|
210 |
+ [AV_PIX_FMT_GBRAP12BE] = { 1, 0 }, |
|
209 | 211 |
[AV_PIX_FMT_GBRP14LE] = { 1, 1 }, |
210 | 212 |
[AV_PIX_FMT_GBRP14BE] = { 1, 1 }, |
211 | 213 |
[AV_PIX_FMT_GBRP16LE] = { 1, 0 }, |
... | ... |
@@ -1083,6 +1085,9 @@ static enum AVPixelFormat alphaless_fmt(enum AVPixelFormat fmt) |
1083 | 1083 |
|
1084 | 1084 |
case AV_PIX_FMT_GBRAP: return AV_PIX_FMT_GBRP; |
1085 | 1085 |
|
1086 |
+ case AV_PIX_FMT_GBRAP12LE: return AV_PIX_FMT_GBRP12; |
|
1087 |
+ case AV_PIX_FMT_GBRAP12BE: return AV_PIX_FMT_GBRP12; |
|
1088 |
+ |
|
1086 | 1089 |
case AV_PIX_FMT_GBRAP16LE: return AV_PIX_FMT_GBRP16; |
1087 | 1090 |
case AV_PIX_FMT_GBRAP16BE: return AV_PIX_FMT_GBRP16; |
1088 | 1091 |
|
... | ... |
@@ -1352,6 +1357,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, |
1352 | 1352 |
srcFormat != AV_PIX_FMT_GBRP9BE && srcFormat != AV_PIX_FMT_GBRP9LE && |
1353 | 1353 |
srcFormat != AV_PIX_FMT_GBRP10BE && srcFormat != AV_PIX_FMT_GBRP10LE && |
1354 | 1354 |
srcFormat != AV_PIX_FMT_GBRP12BE && srcFormat != AV_PIX_FMT_GBRP12LE && |
1355 |
+ srcFormat != AV_PIX_FMT_GBRAP12BE && srcFormat != AV_PIX_FMT_GBRAP12LE && |
|
1355 | 1356 |
srcFormat != AV_PIX_FMT_GBRP14BE && srcFormat != AV_PIX_FMT_GBRP14LE && |
1356 | 1357 |
srcFormat != AV_PIX_FMT_GBRP16BE && srcFormat != AV_PIX_FMT_GBRP16LE && |
1357 | 1358 |
srcFormat != AV_PIX_FMT_GBRAP16BE && srcFormat != AV_PIX_FMT_GBRAP16LE && |