summaryrefslogtreecommitdiff
path: root/libswscale/output.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2019-05-09 21:02:09 -0700
committerPhilip Langdale <philipl@overt.org>2019-05-12 07:51:02 -0700
commitcd483180356c8f206f32393acc52a85c5b76758b (patch)
tree06d6ff23172861b896fe3de72b4a431192ed4522 /libswscale/output.c
parent5de4f1d871d60886b9630531fa8c34cad13cc9dd (diff)
downloadffmpeg-cd483180356c8f206f32393acc52a85c5b76758b.tar.gz
swscale: Add support for NV24 and NV42
The implementation is pretty straight-forward. Most of the existing NV12 codepaths work regardless of subsampling and are re-used as is. Where necessary I wrote the slightly different NV24 versions. Finally, the one thing that confused me for a long time was the asm specific x86 path that did an explicit exclusion check for NV12. I replaced that with a semi-planar check and also updated the equivalent PPC code, which Lauri kindly checked.
Diffstat (limited to 'libswscale/output.c')
-rw-r--r--libswscale/output.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index d3401f0cd1..26b0ff3d48 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -410,7 +410,8 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS
const uint8_t *chrDither = c->chrDither8;
int i;
- if (dstFormat == AV_PIX_FMT_NV12)
+ if (dstFormat == AV_PIX_FMT_NV12 ||
+ dstFormat == AV_PIX_FMT_NV24)
for (i=0; i<chrDstW; i++) {
int u = chrDither[i & 7] << 12;
int v = chrDither[(i + 3) & 7] << 12;
@@ -2496,7 +2497,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
} else {
*yuv2plane1 = yuv2plane1_8_c;
*yuv2planeX = yuv2planeX_8_c;
- if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)
+ if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21 ||
+ dstFormat == AV_PIX_FMT_NV24 || dstFormat == AV_PIX_FMT_NV42)
*yuv2nv12cX = yuv2nv12cX_c;
}