diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-07-03 12:15:47 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-07-24 03:44:58 +0000 |
commit | 052f64ecb2f1381e721920dd4f64fd8470c246b5 (patch) | |
tree | 582a456aa272cc3cd5f814e7743611e1964538eb /libswscale/input.c | |
parent | f0489a35c034a2c898c917e66176dc7c5c420357 (diff) | |
download | ffmpeg-streaming-052f64ecb2f1381e721920dd4f64fd8470c246b5.zip ffmpeg-streaming-052f64ecb2f1381e721920dd4f64fd8470c246b5.tar.gz |
swscale: ayuv64le input support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libswscale/input.c')
-rw-r--r-- | libswscale/input.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libswscale/input.c b/libswscale/input.c index 1f04fc2..5906ea8 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -607,6 +607,33 @@ static void read_ya16be_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t AV_WN16(dst + i * 2, AV_RB16(src + i * 4 + 2)); } +static void read_ayuv64le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, + uint32_t *unused2) +{ + int i; + for (i = 0; i < width; i++) + AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2)); +} + + +static void read_ayuv64le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, + const uint8_t *unused1, int width, uint32_t *unused2) +{ + int i; + for (i = 0; i < width; i++) { + AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 4)); + AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6)); + } +} + +static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, + uint32_t *unused2) +{ + int i; + for (i = 0; i < width; i++) + AV_WN16(dst + i * 2, AV_RL16(src + i * 8)); +} + /* This is almost identical to the previous, end exists only because * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */ static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, @@ -987,6 +1014,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) c->chrToYV12 = bswap16UV_c; break; #endif + case AV_PIX_FMT_AYUV64LE: + c->chrToYV12 = read_ayuv64le_UV_c; + break; } if (c->chrSrcHSubSample) { switch (srcFormat) { @@ -1271,6 +1301,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YA16BE: c->lumToYV12 = read_ya16be_gray_c; break; + case AV_PIX_FMT_AYUV64LE: + c->lumToYV12 = read_ayuv64le_Y_c; + break; case AV_PIX_FMT_YUYV422: case AV_PIX_FMT_YVYU422: case AV_PIX_FMT_YA8: @@ -1397,6 +1430,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YA16BE: c->alpToYV12 = read_ya16be_alpha_c; break; + case AV_PIX_FMT_AYUV64LE: + c->alpToYV12 = read_ayuv64le_A_c; + break; case AV_PIX_FMT_PAL8 : c->alpToYV12 = palToA_c; break; |