[FFmpeg-devel] [PATCH 22/26] swscale/input: add V30X input support
Michael Niedermayer
michael at niedermayer.cc
Tue Oct 8 23:50:43 EEST 2024
On Mon, Oct 07, 2024 at 11:54:00PM -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> libswscale/input.c | 26 ++++++++++++++++++++++++++
> libswscale/utils.c | 1 +
> 2 files changed, 27 insertions(+)
>
> diff --git a/libswscale/input.c b/libswscale/input.c
> index 7237333e56..3d97c555a3 100644
> --- a/libswscale/input.c
> +++ b/libswscale/input.c
> @@ -764,6 +764,26 @@ static void vyuToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, cons
> }
> }
>
> +static void read_v30xle_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
> + uint32_t *unused2, void *opq)
> +{
> + int i;
> + for (i = 0; i < width; i++)
> + AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 12) & 0x3FFu);
> +}
> +
> +
> +static void read_v30xle_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, void *opq)
> +{
> + int i;
> + for (i = 0; i < width; i++) {
> + uint32_t pixel = AV_RL32(src + i * 4);
> + AV_WN16(dstU + i * 2, (pixel >> 2) & 0x3FFu);
> + AV_WN16(dstV + i * 2, (pixel >> 22) & 0x3FFu);
> + }
> +}
on ppc:
src/libswscale/input.c: In function ‘read_v30xle_UV_c’:
src/libswscale/input.c:781:18: error: two or more data types in declaration specifiers
uint32_t pixel = AV_RL32(src + i * 4);
^
src/libswscale/input.c:781:18: error: two or more data types in declaration specifiers
uint32_t pixel = AV_RL32(src + i * 4);
^
src/libswscale/input.c:781:24: error: expected identifier or ‘(’ before ‘=’ token
uint32_t pixel = AV_RL32(src + i * 4);
^
In file included from src/libswscale/input.c:26:0:
src/libswscale/input.c:782:38: error: expected ‘)’ before ‘>>’ token
AV_WN16(dstU + i * 2, (pixel >> 2) & 0x3FFu);
^
src/libavutil/intreadwrite.h:221:66: note: in definition of macro ‘AV_WN’
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
^
src/libswscale/input.c:782:9: note: in expansion of macro ‘AV_WN16’
AV_WN16(dstU + i * 2, (pixel >> 2) & 0x3FFu);
^~~~~~~
src/libswscale/input.c:782:45: error: lvalue required as unary ‘&’ operand
AV_WN16(dstU + i * 2, (pixel >> 2) & 0x3FFu);
^
src/libavutil/intreadwrite.h:221:66: note: in definition of macro ‘AV_WN’
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
^
src/libswscale/input.c:782:9: note: in expansion of macro ‘AV_WN16’
AV_WN16(dstU + i * 2, (pixel >> 2) & 0x3FFu);
^~~~~~~
src/libswscale/input.c:783:38: error: expected ‘)’ before ‘>>’ token
AV_WN16(dstV + i * 2, (pixel >> 22) & 0x3FFu);
^
src/libavutil/intreadwrite.h:221:66: note: in definition of macro ‘AV_WN’
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
^
src/libswscale/input.c:783:9: note: in expansion of macro ‘AV_WN16’
AV_WN16(dstV + i * 2, (pixel >> 22) & 0x3FFu);
^~~~~~~
src/libswscale/input.c:783:45: error: lvalue required as unary ‘&’ operand
AV_WN16(dstV + i * 2, (pixel >> 22) & 0x3FFu);
^
src/libavutil/intreadwrite.h:221:66: note: in definition of macro ‘AV_WN’
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
^
src/libswscale/input.c:783:9: note: in expansion of macro ‘AV_WN16’
AV_WN16(dstV + i * 2, (pixel >> 22) & 0x3FFu);
^~~~~~~
make: *** [src/ffbuild/common.mak:81: libswscale/input.o] Error 1
make: *** Waiting for unfinished jobs....
[...]
thx
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
than the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241008/9806c633/attachment.sig>
More information about the ffmpeg-devel
mailing list