34
34
#include < cmath>
35
35
36
36
/* ************************************************************************** */
37
- /*
37
+
38
+ // Flat scaling lists
39
+
40
+ int8_t Flat_4x4[16 ] = { 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 };
41
+
42
+ int8_t Flat_8x8[64 ] = { 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 ,
43
+ 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 ,
44
+ 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 ,
45
+ 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 };
46
+
38
47
// Default scaling lists
39
48
40
- int Default_4x4_Intra[16] = { 6, 13, 13, 20, 20, 20, 28, 28, 28, 28, 32, 32, 32, 37, 37, 42};
49
+ int8_t Default_4x4_Intra[16 ] = { 6 , 13 , 13 , 20 , 20 , 20 , 28 , 28 , 28 , 28 , 32 , 32 , 32 , 37 , 37 , 42 };
41
50
42
- int Default_4x4_Inter[16] = {10, 14, 14, 20, 20, 20, 24, 24, 24, 24, 27, 27, 27, 30, 30, 34};
51
+ int8_t Default_4x4_Inter[16 ] = { 10 , 14 , 14 , 20 , 20 , 20 , 24 , 24 , 24 , 24 , 27 , 27 , 27 , 30 , 30 , 34 };
43
52
44
- int Default_8x8_Intra[64] = { 6, 10, 10, 13, 11, 13, 16, 16, 16, 16, 18, 18, 18, 18, 18, 23,
45
- 23, 23, 23, 23, 23, 25, 25, 25, 25, 25, 25, 25, 27, 27, 27, 27,
46
- 27, 27, 27, 27, 29, 29, 29, 29, 29, 29, 29, 31, 31, 31, 31, 31,
47
- 31, 33, 33, 33, 33, 33, 36, 36, 36, 36, 38, 38, 38, 40, 40, 42};
53
+ int8_t Default_8x8_Intra[64 ] = { 6 , 10 , 10 , 13 , 11 , 13 , 16 , 16 , 16 , 16 , 18 , 18 , 18 , 18 , 18 , 23 ,
54
+ 23 , 23 , 23 , 23 , 23 , 25 , 25 , 25 , 25 , 25 , 25 , 25 , 27 , 27 , 27 , 27 ,
55
+ 27 , 27 , 27 , 27 , 29 , 29 , 29 , 29 , 29 , 29 , 29 , 31 , 31 , 31 , 31 , 31 ,
56
+ 31 , 33 , 33 , 33 , 33 , 33 , 36 , 36 , 36 , 36 , 38 , 38 , 38 , 40 , 40 , 42 };
57
+
58
+ int8_t Default_8x8_Inter[64 ] = { 9 , 13 , 13 , 15 , 13 , 15 , 17 , 17 , 17 , 17 , 19 , 19 , 19 , 19 , 19 , 21 ,
59
+ 21 , 21 , 21 , 21 , 21 , 22 , 22 , 22 , 22 , 22 , 22 , 22 , 24 , 24 , 24 , 24 ,
60
+ 24 , 24 , 24 , 24 , 25 , 25 , 25 , 25 , 25 , 25 , 25 , 27 , 27 , 27 , 27 , 27 ,
61
+ 27 , 28 , 28 , 28 , 28 , 28 , 30 , 30 , 30 , 30 , 32 , 32 , 32 , 33 , 33 , 35 };
48
62
49
- int Default_8x8_Inter[64] = { 9, 13, 13, 15, 13, 15, 17, 17, 17, 17, 19, 19, 19, 19, 19, 21,
50
- 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 24, 24, 24, 24,
51
- 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 27, 27, 27, 27, 27,
52
- 27, 28, 28, 28, 28, 28, 30, 30, 30, 30, 32, 32, 32, 33, 33, 35};
53
- */
54
63
/* ************************************************************************** */
55
64
56
65
const int idct_dccoeff_2x2[2 ][2 ] =
57
66
{
58
- { 1 , 1 },
59
- { 1 ,- 1 }
67
+ { 1 , 1 },
68
+ { 1 , - 1 }
60
69
};
61
70
62
71
const int idct_dccoeff_4x4[4 ][4 ] =
63
72
{
64
- { 1 , 1 , 1 , 1 },
65
- { 1 , 1 , -1 ,- 1 },
66
- { 1 ,-1 ,-1 , 1 },
67
- { 1 ,-1 , 1 ,- 1 }
73
+ { 1 , 1 , 1 , 1 },
74
+ { 1 , 1 , -1 , - 1 },
75
+ { 1 , -1 , -1 , 1 },
76
+ { 1 , -1 , 1 , - 1 }
68
77
};
69
78
70
79
// / Use Table 8-15: Specification of QPC as a function of qPI
71
- const int QPCfunctionofqPI[22 ] = {29 , 30 , 31 , 32 , 32 , 33 , 34 , 34 , 35 , 35 , 36 , 36 , 37 , 37 , 37 , 38 , 38 , 38 , 39 , 39 , 39 , 39 };
80
+ const int QPCfunctionofqPI[22 ] = { 29 , 30 , 31 , 32 , 32 , 33 , 34 , 34 , 35 , 35 , 36 , 36 , 37 , 37 , 37 , 38 , 38 , 38 , 39 , 39 , 39 , 39 };
72
81
73
82
// / Figure 8-7: Assignment of the indices of dcC to chroma4x4BlkIdx when ChromaArrayType equal to 2
74
- const int raster_chroma_cat2_2d[8 ][2 ] = {{0 ,0 }, {0 ,1 }, {1 ,0 }, {1 ,1 }, {2 ,0 }, {2 ,1 }, {3 ,0 }, {3 ,1 }};
83
+ const int raster_chroma_cat2_2d[8 ][2 ] = { {0 ,0 }, {0 ,1 }, {1 ,0 }, {1 ,1 }, {2 ,0 }, {2 ,1 }, {3 ,0 }, {3 ,1 } };
75
84
76
85
/* ************************************************************************** */
77
86
@@ -645,10 +654,9 @@ void computeLevelScale4x4(DecodingContext_t *dc, h264_sps_t *sps)
645
654
{
646
655
// Initialization
647
656
int YCbCr = 0 , q = 0 , i = 0 , j = 0 ;
648
-
649
- #if ENABLE_INTER_PRED
650
657
bool mbIsInterFlag = false ;
651
658
659
+ #if ENABLE_INTER_PRED
652
660
if (mb->MbPartPredMode [0 ] > 3 )
653
661
{
654
662
mbIsInterFlag = true ;
@@ -666,12 +674,20 @@ void computeLevelScale4x4(DecodingContext_t *dc, h264_sps_t *sps)
666
674
}
667
675
#endif // ENABLE_SEPARATE_COLOUR_PLANES
668
676
669
- // Compute
677
+ // Compute // if we have scaling lists
670
678
for (YCbCr = 0 ; YCbCr < 3 ; YCbCr++)
679
+ {
671
680
for (q = 0 ; q < 6 ; q++)
681
+ {
672
682
for (i = 0 ; i < 4 ; i++)
683
+ {
673
684
for (j = 0 ; j < 4 ; j++)
674
- sps->LevelScale4x4 [YCbCr][q][i][j] = sps->ScalingMatrix4x4 [YCbCr /* + ((mbIsInterFlag == true) ? 3 : 0)*/ ][i][j] * dc->normAdjust4x4 [q][i][j];
685
+ {
686
+ sps->LevelScale4x4 [YCbCr][q][i][j] = sps->ScalingMatrix4x4 [YCbCr + ((mbIsInterFlag) ? 3 : 0 )][i][j] * dc->normAdjust4x4 [q][i][j];
687
+ }
688
+ }
689
+ }
690
+ }
675
691
/*
676
692
// Print
677
693
for (YCbCr = 0; YCbCr < 3; YCbCr++)
@@ -701,10 +717,9 @@ void computeLevelScale8x8(DecodingContext_t *dc, h264_sps_t *sps)
701
717
{
702
718
// Initialization
703
719
int YCbCr = 0 , q = 0 , i = 0 , j = 0 ;
704
-
705
- #if ENABLE_INTER_PRED
706
720
bool mbIsInterFlag = false ;
707
721
722
+ #if ENABLE_INTER_PRED
708
723
if (mb->MbPartPredMode [0 ] > 3 )
709
724
{
710
725
mbIsInterFlag = true ;
@@ -722,12 +737,20 @@ void computeLevelScale8x8(DecodingContext_t *dc, h264_sps_t *sps)
722
737
}
723
738
#endif // ENABLE_SEPARATE_COLOUR_PLANES
724
739
725
- // Compute
740
+ // Compute // we have SPS scaling lists
726
741
for (YCbCr = 0 ; YCbCr < 3 ; YCbCr++)
742
+ {
727
743
for (q = 0 ; q < 6 ; q++)
744
+ {
728
745
for (i = 0 ; i < 8 ; i++)
746
+ {
729
747
for (j = 0 ; j < 8 ; j++)
730
- sps->LevelScale8x8 [YCbCr][q][i][j] = sps->ScalingMatrix8x8 [YCbCr /* + ((mbIsInterFlag == true) ? 3 : 0)*/ ][i][j] * dc->normAdjust8x8 [q][i][j];
748
+ {
749
+ sps->LevelScale8x8 [YCbCr][q][i][j] = sps->ScalingMatrix8x8 [YCbCr + ((mbIsInterFlag) ? 3 : 0 )][i][j] * dc->normAdjust8x8 [q][i][j];
750
+ }
751
+ }
752
+ }
753
+ }
731
754
/*
732
755
// Print
733
756
for (YCbCr = 0; YCbCr < 3; YCbCr++)
0 commit comments