jinbo
a28eea2a27
avcodec/hevc: Add pel_uni_w_pixels4/6/8/12/16/24/32/48/64 asm opt
...
tests/checkasm/checkasm: C LSX LASX
put_hevc_pel_uni_w_pixels4_8_c: 2.7 1.0
put_hevc_pel_uni_w_pixels6_8_c: 6.2 2.0 1.5
put_hevc_pel_uni_w_pixels8_8_c: 10.7 2.5 1.7
put_hevc_pel_uni_w_pixels12_8_c: 23.0 5.5 5.0
put_hevc_pel_uni_w_pixels16_8_c: 41.0 8.2 5.0
put_hevc_pel_uni_w_pixels24_8_c: 91.0 19.7 13.2
put_hevc_pel_uni_w_pixels32_8_c: 161.7 32.5 16.2
put_hevc_pel_uni_w_pixels48_8_c: 354.5 73.7 43.0
put_hevc_pel_uni_w_pixels64_8_c: 641.5 130.0 64.2
Speedup of decoding H265 4K 30FPS 30Mbps on 3A6000 with
8 threads is 1fps(47fps-->48fps).
Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-01-12 23:35:40 +01:00
jinbo
cfbdda607d
avcodec/hevc: Add add_residual_4/8/16/32 asm opt
...
After this patch, the peformance of decoding H265 4K 30FPS 30Mbps
on 3A6000 with 8 threads improves 2fps (45fps-->47fsp).
Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-01-12 23:35:40 +01:00
Zhao Zhili
13c1fea92f
avcodec/videotoolboxenc: fix setting avctx color_range doesn't work
...
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-01-12 10:49:18 +08:00
Nuo Mi
8d0dda8260
vvcdec: reuse h26x/h2656_deblock_template.c
2024-01-11 22:53:05 +08:00
Nuo Mi
ae0a83477b
hevcdec: move deblock template to h26x/h2656_deblock_template.c
2024-01-11 22:53:05 +08:00
Nuo Mi
69e179e8bf
vvcdec: reuse h26x/h2656_sao_template.c
2024-01-11 22:53:05 +08:00
Nuo Mi
d2fe23b835
hevcdec: move sao template to h26x/h2656_sao_template.c
2024-01-11 22:53:05 +08:00
Clément Bœsch
af509f9957
avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields
...
The layout for the frame flags is as follow:
chroma_format u(2)
reserved u(2)
interlace_mode u(2)
reserved u(2)
chroma_format has 2 allowed values:
0: reserved
1: reserved
2: 4:2:2
3: 4:4:4
interlace_mode has 3 allowed values:
0: progressive
1: tff
2: bff
3: reserved
0x80 is what we expect for "422 not interlaced", and the extra 0x2 from
0x82 is actually writing into the reserved bits.
2024-01-10 23:33:02 +01:00
Clément Bœsch
21f7a814ea
avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields
...
This byte represents 4 reserved bits followed by 4 alpha_channel_type bits.
alpha_channel_type currently has 3 differents defined values: 0 (no
alpha), 1 (8b alpha), and 2 (16b alpha), all the other values are
reserved. The 4 initial reserved bits are expected to be 0.
2024-01-10 23:33:02 +01:00
Clément Bœsch
6d35911667
avcodec/proresenc_kostya: do not write into alpha reserved bitfields
...
This byte represents 4 reserved bits followed by 4 alpha_channel_type bits.
alpha_channel_type currently has 3 differents defined values: 0 (no
alpha), 1 (8b alpha), and 2 (16b alpha), all the other values are
reserved. This part is correctly written (alpha_bits>>3 does the correct
thing), but the 4 initial bits are reserved.
2024-01-10 23:33:02 +01:00
Clément Bœsch
aa7ccd0ce9
avcodec/proresenc_kostya: use a compatible bitstream version
...
Quoting SMPTE RDD 36:2015:
A decoder shall abort if it encounters a bitstream with an unsupported
bitstream_version value. If 0, the value of the chroma_format syntax
element shall be 2 (4:2:2 sampling) and the value of the
alpha_channel_type element shall be 0 (no encoded alpha); if 1, any
permissible value may be used for those syntax elements.
So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
version 0.
2024-01-10 23:33:02 +01:00
Clément Bœsch
85cb1b9b20
avcodec/proresenc_anatoliy: use a compatible bitstream version
...
Quoting SMPTE RDD 36:2015:
A decoder shall abort if it encounters a bitstream with an unsupported
bitstream_version value. If 0, the value of the chroma_format syntax
element shall be 2 (4:2:2 sampling) and the value of the
alpha_channel_type element shall be 0 (no encoded alpha); if 1, any
permissible value may be used for those syntax elements.
So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
version 0.
2024-01-10 23:33:02 +01:00
Clément Bœsch
1081bae94d
avcodec/proresenc_kostya: make a few cosmetics in encode_acs()
...
Unify cosmetics with encode_acs() from proresenc_anatoliy.
2024-01-10 14:08:00 +01:00
Clément Bœsch
cc2206d142
avcodec/proresenc_anatoliy: make a few cosmetics in encode_acs()
...
This makes the function pretty much identical to the function of the
same name in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
8fb2e96d7e
avcodec/proresenc_anatoliy: execute AC run/level FFMIN() at assignment
...
This matches the logic from the function of the same name in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
096a69ad43
avcodec/proresenc_anatoliy: rework inner loop in encode_acs()
...
This matches the logic from the function of the same name in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
25f28b9308
avcodec/proresenc_anatoliy: avoid using ff_ prefix in function arguments
2024-01-10 14:08:00 +01:00
Clément Bœsch
29fd3f75fe
avcodec/proresenc_anatoliy: rework encode_ac_coeffs() prototype
...
This makes the prototype closer to the function of the same name in
proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
3543100a05
avcodec/proresenc_anatoliy: replace get_level() with FFABS()
...
This matches the code from proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
ed8692446c
avcodec/proresenc_anatoliy: cosmetics to make encode_dcs() identical to the one in Kostya encoder
2024-01-10 14:08:00 +01:00
Clément Bœsch
e87bc5641c
avcodec/proresenc_anatoliy: remove TO_GOLOMB2()
...
A few cosmetics aside, this makes the function identical to the one with
the same name in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
a026f98f29
avcodec/proresenc_anatoliy: only pass down the first scale to encode_dcs()
...
This matches encode_dcs() prototype from proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
1aa7d504ec
avcodec/proresenc_anatoliy: shuffle declarations around in encode_dcs()
...
This makes the function closer to the same function in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
87ba89281c
avcodec/proresenc_anatoliy: rename TO_GOLOMB() to MAKE_CODE()
...
This matches the name in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
7af42088d7
avcodec/proresenc_kostya: add Anatoliy copyright
...
Both encoders share a lot of code from both authors.
2024-01-10 14:08:00 +01:00
Clément Bœsch
d269f84199
avcodec/proresenc_anatoliy: remove IS_NEGATIVE() macro
...
This makes the function closer to encode_acs() in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
9c7f6d89fd
avcodec/proresenc_anatoliy: rename new_dc to dc
...
This makes the function closer to encode_dcs() in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
9258f4eaf9
avcodec/proresenc_anatoliy: compute sign only once
...
This makes the function closer to encode_dcs() in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
17392ca84f
avcodec/proresenc_anatoliy: import GET_SIGN() macro from Kostya encoder and use it
2024-01-10 14:08:00 +01:00
Clément Bœsch
273f591a3d
avcodec/proresenc_anatoliy: directly work with blocks in encode_dcs()
...
This makes the function closer to encode_dcs() in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
dadc5ac24a
avcodec/proresenc_anatoliy: reduce DC encoding function prototype differences with Kostya encoder
2024-01-10 14:08:00 +01:00
Clément Bœsch
8e42d3aba0
avcodec/proresenc_anatoliy: execute codebook FFMIN() at assignment
...
This makes the function closer to encode_dcs() in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
43baba4647
avcodec/proresenc_anatoliy: rename new_code/code to code/codebook
...
This makes the function closer to encode_dcs() in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
c44cd371ca
avcodec/proresenc_anatoliy: inline QSCALE()
...
Also replaces 16384 with 0x4000.
This makes the function slightly closer to same function in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
1574475033
avcodec/proresenc_anatoliy: rework encode_codeword() prototype
...
This matches the function of the same name in proresenc_kostya.
2024-01-10 14:08:00 +01:00
Clément Bœsch
1832bd7838
avcodec/proresenc_anatoliy: shuffle encode_codeword() code to match Kostya encoder
...
Code is functionally identical, it's just rename of variables, cosmetics
and branch logic shuffling.
2024-01-10 14:08:00 +01:00
Clément Bœsch
3885d2493d
avcodec/proresenc_anatoliy: use FRAME_ID defined in proresdata.h
2024-01-10 14:08:00 +01:00
Clément Bœsch
d6e0fb7c92
avcodec/proresenc_kostya: simplify quantization matrix bytestream writing
2024-01-10 14:08:00 +01:00
Clément Bœsch
cbee015867
avcodec/proresenc_kostya: fix chroma quantisation matrix in frame header
...
Most of the time the quantisation matrices are the same, it only matters
with the proxy profile.
2024-01-10 14:08:00 +01:00
Clément Bœsch
631fa19ee0
avcodec/proresenc_kostya: save a few operations in DC encoding
...
This matches the logic from proresenc_anatoliy.
2024-01-10 14:08:00 +01:00
Clément Bœsch
f06f2cf16a
avcodec/proresenc_anatoliy: move DC codebook LUT to shared proresdata
...
This is going to be shared with proresenc_kostya in the upcoming commit.
2024-01-10 14:08:00 +01:00
Clément Bœsch
9f547e2f15
avcodec/proresenc_anatoliy: remove duplicated define
...
This is already defined in proresdata.h
2024-01-10 14:08:00 +01:00
Clément Bœsch
c35733006a
avcodec/proresenc_kostya: remove one LUT indirection for run/level to codebook mapping
...
This is following the same logic as proresenc_anatoliy.
2024-01-10 14:08:00 +01:00
Clément Bœsch
3ba52f18e4
avcodec/proresenc_anatoliy: move run/lev to codebook LUT to shared proresdata
...
This is going to be shared with proresenc_kostya in the upcoming commit.
2024-01-10 14:08:00 +01:00
Clément Bœsch
e940baa65b
avcodec/proresenc_kostya: remove redundant codebook assignments
...
This is already assigned at declaration.
2024-01-10 14:08:00 +01:00
Clément Bœsch
e453efcfbc
avcodec/proresenc_kostya: remove unused plane factor variables
2024-01-10 14:08:00 +01:00
Clément Bœsch
2ac88c1362
avcodec/proresenc_kostya: remove an unnecessary parenthesis level in MAKE_CODE() macro
2024-01-10 14:08:00 +01:00
Marton Balint
363b3ec98a
all: use av_channel_layout_describe_bprint instead of av_channel_layout_describe in a few places
...
Where an AVBPrint buffer is used later anyway.
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-01-07 22:47:22 +01:00
James Almer
b95ccfcada
avcodec/vvc_thread: don't use an anonymous union
...
Should fix compilation with old GCC.
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-06 23:28:03 -03:00
Nuo Mi
02d600c568
vvcdec: add TODO for combining transform, lmcs_scale_chroma, and add_residual
...
Thanks for the suggestion from Lynne.
2024-01-07 09:01:04 +08:00