1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

swscale: do not forget to swap data in formats with different endianness

Otherwise during scaling it will try to interpret input in the wrong way and
that leads to the test results disagreeing on different platforms and with
different optimizations.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
Kostya Shishkov 2012-10-31 11:26:32 +01:00 committed by Diego Biurrun
parent 5707af8d0b
commit 38fdf72580
2 changed files with 50 additions and 8 deletions

View File

@ -724,6 +724,15 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUV420P16LE:
case AV_PIX_FMT_YUV422P16LE:
case AV_PIX_FMT_YUV444P16LE:
case AV_PIX_FMT_YUVA444P9LE:
case AV_PIX_FMT_YUVA422P9LE:
case AV_PIX_FMT_YUVA420P9LE:
case AV_PIX_FMT_YUVA422P10LE:
case AV_PIX_FMT_YUVA444P10LE:
case AV_PIX_FMT_YUVA420P10LE:
case AV_PIX_FMT_YUVA420P16LE:
case AV_PIX_FMT_YUVA422P16LE:
case AV_PIX_FMT_YUVA444P16LE:
c->chrToYV12 = bswap16UV_c;
break;
#else
@ -736,6 +745,15 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUV420P16BE:
case AV_PIX_FMT_YUV422P16BE:
case AV_PIX_FMT_YUV444P16BE:
case AV_PIX_FMT_YUVA444P9BE:
case AV_PIX_FMT_YUVA422P9BE:
case AV_PIX_FMT_YUVA420P9BE:
case AV_PIX_FMT_YUVA422P10BE:
case AV_PIX_FMT_YUVA444P10BE:
case AV_PIX_FMT_YUVA420P10BE:
case AV_PIX_FMT_YUVA420P16BE:
case AV_PIX_FMT_YUVA422P16BE:
case AV_PIX_FMT_YUVA444P16BE:
c->chrToYV12 = bswap16UV_c;
break;
#endif
@ -917,6 +935,18 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_GRAY16LE:
c->lumToYV12 = bswap16Y_c;
break;
case AV_PIX_FMT_YUVA444P9LE:
case AV_PIX_FMT_YUVA422P9LE:
case AV_PIX_FMT_YUVA420P9LE:
case AV_PIX_FMT_YUVA444P10LE:
case AV_PIX_FMT_YUVA422P10LE:
case AV_PIX_FMT_YUVA420P10LE:
case AV_PIX_FMT_YUVA420P16LE:
case AV_PIX_FMT_YUVA422P16LE:
case AV_PIX_FMT_YUVA444P16LE:
c->lumToYV12 = bswap16Y_c;
c->alpToYV12 = bswap16Y_c;
break;
#else
case AV_PIX_FMT_YUV444P9BE:
case AV_PIX_FMT_YUV422P9BE:
@ -930,6 +960,18 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_GRAY16BE:
c->lumToYV12 = bswap16Y_c;
break;
case AV_PIX_FMT_YUVA444P9BE:
case AV_PIX_FMT_YUVA422P9BE:
case AV_PIX_FMT_YUVA420P9BE:
case AV_PIX_FMT_YUVA444P10BE:
case AV_PIX_FMT_YUVA422P10BE:
case AV_PIX_FMT_YUVA420P10BE:
case AV_PIX_FMT_YUVA420P16BE:
case AV_PIX_FMT_YUVA422P16BE:
case AV_PIX_FMT_YUVA444P16BE:
c->lumToYV12 = bswap16Y_c;
c->alpToYV12 = bswap16Y_c;
break;
#endif
case AV_PIX_FMT_YUYV422:
case AV_PIX_FMT_Y400A:

View File

@ -57,25 +57,25 @@ yuv444p16le a0c5d3c7bf3f181db503cf8e450d1335
yuv444p9be 9ac2643ce7f7e5c4e17c8c9fd8494d4a
yuv444p9le 896a1cc9cccca1ba410dd53942d33cc4
yuva420p 8673a9131fb47de69788863f93a50eb7
yuva420p10be cf397b35db9407496093b2ad64f3106c
yuva420p10be d92a95061809f251175f5d5e3074930e
yuva420p10le 8a06c377b8aa2b2979054e074582a5b5
yuva420p16be a61d8ddb646e2d26020fc7ed2a48c1a9
yuva420p16le 90ef774f86ad3177ec57eca8744b4e09
yuva420p9be b43d5d88a474c80abad8e887eb5a3317
yuva420p9be f7655546446bfdc875243d7cdeb13b30
yuva420p9le ada2b719827059d70ebc57e2a3f9da92
yuva422p 3c76ebeca0a7d3aa5f8e31ef80a86ffe
yuva422p10be c12a427d2b8fc84f93fd3cf9fd5bcb14
yuva422p10be 9a21b2f566c0761c8338edaa88006bee
yuva422p10le aefcda062e7e3463c887faa9d926aca7
yuva422p16be a31bd04c58c22690f2a7c745f34cf48f
yuva422p16be c21afa31ac18bd92e8e596b81552b52b
yuva422p16le 0bc3720dba6076dcce3b74b1d3c6c4b7
yuva422p9be b21d2aa97ff643c86bbc08b578729c39
yuva422p9be a60ac5b8026e9621724c033fbf79dbda
yuva422p9le c3eda8831e9b9c94a3eb487d33114103
yuva444p 3268c6abe5e3cdbd16552a1eddced816
yuva444p10be 4f6eaf2bbe8a083773b9f061fec20e41
yuva444p10be 3fbd1ece625c7aa7284b9ca3724d6abb
yuva444p10le 2eeda83856df77760cd30e477e8ba00b
yuva444p16be 3587f05da58a8435aad648506562d39b
yuva444p16be ed5b07fe4d5b1137604568786777af1d
yuva444p16le 3a3df23feb60d8832b566fd9765983d0
yuva444p9be d5342be0074975ea65907f5b65c7a335
yuva444p9be 4fc479c5b1044ad37b4e6fc6488b4f7f
yuva444p9le c41849b0134670d6f6253c337defbb04
yuvj420p 30427bd6caf5bda93a173dbebe759e09
yuvj422p fc8288f64fd149573f73cf8da05d8e6d