Skip to content

Commit e9fc301

Browse files
committed
corrcet bug for RA
1 parent 31b9985 commit e9fc301

File tree

3 files changed

+35
-45
lines changed

3 files changed

+35
-45
lines changed

libavcodec/hevc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,12 +1552,10 @@ do {
15521552
}
15531553

15541554
#if COM16_C806_EMT
1555-
15561555
if (0 == trafo_depth)
15571556
{
15581557
s->HEVClc->cu.emt_cu_flag = ff_hevc_emt_cu_flag_decode(s, log2_cb_size, cbf_luma);
15591558
}
1560-
15611559
#endif
15621560

15631561

libavcodec/hevc_cabac.c

Lines changed: 32 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626

2727
#include "cabac_functions.h"
2828
#include "hevc.h"
29-
#include "avfft.h"
3029

30+
#if COM16_C806_EMT
31+
#include "avfft.h"
32+
#endif
3133

3234
#define CABAC_MAX_BIN 31
3335

@@ -773,9 +775,6 @@ int ff_hevc_cu_chroma_qp_offset_idx(HEVCContext *s)
773775
}
774776

775777
#if COM16_C806_EMT
776-
/*
777-
* Définition de la fonction emt_cu_flag_decode
778-
*/
779778
uint8_t ff_hevc_emt_cu_flag_decode(HEVCContext *s, int log2_cb_size, int cbfLuma)
780779
{
781780
uint8_t inc = 0;
@@ -792,9 +791,6 @@ uint8_t ff_hevc_emt_cu_flag_decode(HEVCContext *s, int log2_cb_size, int cbfLuma
792791
}
793792
return flag_value ;
794793
}
795-
/*
796-
* Etape 2
797-
*/
798794
uint8_t ff_hevc_emt_tu_idx_decode(HEVCContext *s, int log2_cb_size)
799795
{
800796
uint8_t trIdx = 0;
@@ -817,10 +813,6 @@ uint8_t ff_hevc_emt_tu_idx_decode(HEVCContext *s, int log2_cb_size)
817813
return trIdx ;
818814
}
819815
#endif
820-
/*
821-
* Fin des fonctions
822-
*/
823-
824816

825817
int ff_hevc_pred_mode_decode(HEVCContext *s)
826818
{
@@ -1854,9 +1846,6 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
18541846
#endif
18551847
}
18561848

1857-
/*
1858-
* Appel de la fonction ff_hevc_tu_idx_decode
1859-
*/
18601849
#if COM16_C806_EMT
18611850
if ( (!transform_skip_flag) && (c_idx == 0) )
18621851
{
@@ -1875,9 +1864,6 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
18751864
}
18761865
}
18771866
#endif
1878-
/*
1879-
* Fin des appels de la fonction
1880-
*/
18811867

18821868
if (lc->cu.cu_transquant_bypass_flag) {
18831869
if (explicit_rdpcm_flag || (s->sps->spsRext.implicit_rdpcm_enabled_flag &&
@@ -1886,6 +1872,25 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
18861872

18871873
s->hevcdsp.transform_rdpcm(coeffs, log2_trafo_size, mode);
18881874
}
1875+
} else {
1876+
if (transform_skip_flag) {
1877+
int rot = s->sps->spsRext.transform_skip_rotation_enabled_flag &&
1878+
log2_trafo_size == 2 &&
1879+
lc->cu.pred_mode == MODE_INTRA;
1880+
if (rot) {
1881+
for (i = 0; i < 8; i++)
1882+
FFSWAP(int16_t, coeffs[i], coeffs[16 - i - 1]);
1883+
}
1884+
1885+
s->hevcdsp.transform_skip(coeffs, log2_trafo_size);
1886+
1887+
if (explicit_rdpcm_flag || (s->sps->spsRext.transform_skip_rotation_enabled_flag &&
1888+
lc->cu.pred_mode == MODE_INTRA &&
1889+
(pred_mode_intra == 10 || pred_mode_intra == 26))) {
1890+
int mode = explicit_rdpcm_flag ? explicit_rdpcm_dir_flag : (pred_mode_intra == 26);
1891+
1892+
s->hevcdsp.transform_rdpcm(coeffs, log2_trafo_size, mode);
1893+
}
18891894
#if COM16_C806_EMT
18901895
}else{
18911896
if( s->HEVClc->cu.emt_cu_flag == 1)
@@ -1908,26 +1913,11 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
19081913
int tu_emt_Idx = s->HEVClc->tu.emt_tu_idx;
19091914
s->hevcdsp.idct_emt(coeffs, coeffs, log2_trafo_size, TRANSFORM_MATRIX_SHIFT, nLog2SizeMinus2, maxLog2TrDynamicRange, bitDepthEMT, ucMode, intraMode, tu_emt_Idx);
19101915
#endif
1911-
} else {
1912-
if (transform_skip_flag) {
1913-
int rot = s->sps->spsRext.transform_skip_rotation_enabled_flag &&
1914-
log2_trafo_size == 2 &&
1915-
lc->cu.pred_mode == MODE_INTRA;
1916-
if (rot) {
1917-
for (i = 0; i < 8; i++)
1918-
FFSWAP(int16_t, coeffs[i], coeffs[16 - i - 1]);
1919-
}
1920-
1921-
s->hevcdsp.transform_skip(coeffs, log2_trafo_size);
1922-
1923-
if (explicit_rdpcm_flag || (s->sps->spsRext.transform_skip_rotation_enabled_flag &&
1924-
lc->cu.pred_mode == MODE_INTRA &&
1925-
(pred_mode_intra == 10 || pred_mode_intra == 26))) {
1926-
int mode = explicit_rdpcm_flag ? explicit_rdpcm_dir_flag : (pred_mode_intra == 26);
1927-
1928-
s->hevcdsp.transform_rdpcm(coeffs, log2_trafo_size, mode);
1929-
}
1930-
} else if (lc->cu.pred_mode == MODE_INTRA && c_idx == 0 && log2_trafo_size == 2) {
1916+
} else
1917+
#if COM16_C806_EMT
1918+
{
1919+
#endif
1920+
if (lc->cu.pred_mode == MODE_INTRA && c_idx == 0 && log2_trafo_size == 2) {
19311921
s->hevcdsp.idct_4x4_luma(coeffs);
19321922
} else {
19331923
int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y);
@@ -1943,8 +1933,12 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
19431933
col_limit = FFMIN(24, col_limit);
19441934
s->hevcdsp.idct[log2_trafo_size-2](coeffs, col_limit);
19451935
}
1936+
#if COM16_C806_EMT
19461937
}
1947-
}
1938+
}
1939+
#endif
1940+
}
1941+
}
19481942
if (lc->tu.cross_pf) {
19491943
int16_t *coeffs_y = lc->tu.coeffs[0];
19501944

@@ -1953,10 +1947,6 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
19531947
}
19541948
}
19551949
s->hevcdsp.transform_add[log2_trafo_size-2](dst, coeffs, stride);
1956-
#if COM16_C806_EMT
1957-
}
1958-
#endif
1959-
19601950
}
19611951

19621952
void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size)

libavcodec/hevcdsp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323

2424
#include "hevc.h"
2525
#include "hevcdsp.h"
26-
#include "dct.h"
2726

2827
#if COM16_C806_EMT
28+
29+
#include "dct.h"
30+
2931
const int emt_Tr_Set_V[35] =
3032
{
3133
2, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 2, 2, 2, 2, 1, 0, 1, 0, 1, 0

0 commit comments

Comments
 (0)