1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-28 12:32:17 +02:00
FFmpeg/libavcodec
Devin Heitmueller b2c82b23b9 avcodec/bitpacked_dec: optimize bitpacked_decode_yuv422p10
Rework the code a bit to speed up the 10-bit bitpacked decoding
routine.  This is probably about as fast as I can get it without
switching to assembly language.

Demonstratable with:

./ffmpeg -f lavfi -i "smptehdbars=size=3840x2160" -c bitpacked -f image2 -frames:v 1 source.yuv
./ffmpeg -f bitpacked -pix_fmt yuv422p10le -s 3840x2160 -c:v bitpacked -i source.yuv -pix_fmt yuv422p10le out.yuv

On my development system, it went from 80ms for a 2160p frame
down to 20ms (i.e. a 4X speedup).  Good enough for now, I hope...

Comments from Marton:

Originally on my system better performance could be achieved by simply
switching to the cached bitstream reader, but for Devin it was slower than
his direct byte operations.

I changed the order of writing output from u/y/v/y to u/v/y/y, and that made
the code faster than the cached bitstream reader on my system as well.

TIMER measurement of the decode loop on Ryzen 5 3600 with command line:

./ffmpeg -stream_loop 256 -threads 1 -f bitpacked -pix_fmt yuv422p10le -s 3840x2160 -c:v bitpacked -i source.yuv -pix_fmt yuv422p10le -f null none -loglevel error

Before: 823204127 decicycles in YUV,     256 runs,      0 skips
After:  315070524 decicycles in YUV,     256 runs,      0 skips

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-12-28 23:56:14 +01:00
..
2023-12-22 17:40:00 +02:00
2023-11-10 00:14:02 +01:00
2023-12-11 18:42:07 +02:00
2023-11-26 17:49:09 +01:00
2023-12-18 15:19:36 -03:00
2023-11-18 19:55:42 +01:00
2023-11-26 17:49:09 +01:00
2023-11-26 17:49:09 +01:00
2023-10-01 02:25:09 +02:00
2023-11-14 19:15:51 +02:00
2023-10-09 19:52:51 +03:00
2023-12-18 15:19:36 -03:00
2023-10-03 00:27:14 +02:00
2023-10-31 21:33:25 +02:00
2023-10-31 21:33:25 +02:00
2023-11-08 17:37:58 +11:00
2023-11-08 17:37:58 +11:00
2023-12-11 18:17:43 +02:00
2023-12-11 18:17:43 +02:00
2023-11-09 12:53:35 +01:00
2023-10-05 22:05:21 +02:00
2023-11-01 22:53:26 +02:00
2023-11-01 22:53:26 +02:00
2023-12-22 09:28:04 -03:00
2023-12-22 09:28:04 -03:00
2023-12-08 17:20:48 +02:00
2023-12-08 17:20:48 +02:00
2023-10-10 00:22:55 +02:00