Skip to content

Commit 6a81875

Browse files
committed
minivideo: minor cleanups
1 parent fae901f commit 6a81875

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

minivideo/src/decoder/h264/h264.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ int h264_decode_nalu(DecodingContext_t *dc, const int64_t nalu_offset, const int
406406
dc->profile_idc = sps->profile_idc;
407407
dc->ChromaArrayType = sps->ChromaArrayType;
408408

409-
// Init some quantization tables
409+
// Init quantization tables
410410
computeLevelScale4x4(dc, sps);
411411
computeLevelScale8x8(dc, sps);
412412

minivideo/src/decoder/h264/h264_intra_prediction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static int ipcm_construction_process(DecodingContext_t *dc, Macroblock_t *mb);
9595
* process and, for Intra_NxN prediction modes (where NxN is equal to 4x4 or 8x8),
9696
* the values of IntraNxNPredMode from neighbouring macroblocks.
9797
*
98-
* The transformations (idct and quantization) must be done block by block inside
98+
* The transformations (IDCT and quantization) must be done block by block inside
9999
* the intra prediction process, because the results (transformed blocks) are
100100
* directly used by the intra prediction process.
101101
*

minivideo/src/decoder/h264/h264_parameterset.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,8 @@ int decodeSPS(Bitstream_t *bitstr, h264_sps_t *sps)
309309
}
310310
}
311311

312-
if (sps->SubWidthC)
313-
sps->MbWidthC = 16 / sps->SubWidthC;
314-
if (sps->SubHeightC)
315-
sps->MbHeightC = 16 / sps->SubHeightC;
312+
if (sps->SubWidthC) sps->MbWidthC = 16 / sps->SubWidthC;
313+
if (sps->SubHeightC) sps->MbHeightC = 16 / sps->SubHeightC;
316314

317315
sps->bit_depth_luma_minus8 = read_ue(bitstr);
318316
sps->BitDepthY = 8 + sps->bit_depth_luma_minus8;
@@ -322,7 +320,7 @@ int decodeSPS(Bitstream_t *bitstr, h264_sps_t *sps)
322320
sps->BitDepthC = 8 + sps->bit_depth_chroma_minus8;
323321
sps->QpBdOffsetC = 6 * sps->bit_depth_chroma_minus8;
324322

325-
sps->RawMbBits = 256 * sps->BitDepthY + 2 * sps->MbWidthC * sps->MbHeightC * sps->BitDepthC;
323+
sps->RawMbBits = (256 * sps->BitDepthY) + (2 * sps->MbWidthC * sps->MbHeightC * sps->BitDepthC);
326324

327325
sps->qpprime_y_zero_transform_bypass_flag = read_bit(bitstr);
328326

@@ -728,10 +726,10 @@ void printSPS(h264_sps_t *sps)
728726
TRACE_1(PARAM, " - seq_scaling_matrix_present_flag = %i", sps->seq_scaling_matrix_present_flag);
729727
if (sps->seq_scaling_matrix_present_flag)
730728
{
731-
for (i = 0; i < ((sps->ChromaArrayType != 3) ? 8 : 12); i++)
732-
{
733-
TRACE_1(PARAM, " - seq_scaling_list_present_flag[%i]= %i", i, sps->seq_scaling_list_present_flag[i]);
734-
}
729+
for (i = 0; i < ((sps->ChromaArrayType != 3) ? 8 : 12); i++)
730+
{
731+
TRACE_1(PARAM, " - seq_scaling_list_present_flag[%i]= %i", i, sps->seq_scaling_list_present_flag[i]);
732+
}
735733
}
736734

737735
TRACE_1(PARAM, " - log2_max_frame_num_minus4 = %i", sps->log2_max_frame_num_minus4);

minivideo/src/decoder/h264/h264_transform.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,12 @@ void computeLevelScale4x4(DecodingContext_t *dc, h264_sps_t *sps)
680680
{
681681
TRACE_1(TRANS, "YCbCr: %i / Qp: %i", YCbCr, q);
682682
for (i = 0; i < 4; i++)
683+
{
683684
for (j = 0; j < 4; j++)
685+
{
684686
TRACE_1(TRANS, "levelscale_4x4: %i", sps->LevelScale4x4[YCbCr][q][i][j]);
687+
}
688+
}
685689
}
686690
}
687691
*/
@@ -732,8 +736,12 @@ void computeLevelScale8x8(DecodingContext_t *dc, h264_sps_t *sps)
732736
{
733737
TRACE_1(TRANS, "YCbCr: %i / Qp: %i", YCbCr, q);
734738
for (i = 0; i < 8; i++)
739+
{
735740
for (j = 0; j < 8; j++)
741+
{
736742
TRACE_1(TRANS, " levelscale_8x8[%i][%i]: %i", i, j, sps->LevelScale8x8[YCbCr][q][i][j]);
743+
}
744+
}
737745
}
738746
}
739747
*/
@@ -750,7 +758,7 @@ void computeLevelScale8x8(DecodingContext_t *dc, h264_sps_t *sps)
750758
* From 'ITU-T H.264' recommendation:
751759
* 8.5.10 Scaling and transformation process for DC transform coefficients for Intra_16x16 macroblock type.
752760
*
753-
* Note: For DC coefficients, the quantization is done after the idct.
761+
* Note: For DC coefficients, the quantization is done after the IDCT.
754762
*/
755763
static int transform_16x16_lumadc(DecodingContext_t *dc, const int c[4][4], int dcY[4][4])
756764
{
@@ -821,7 +829,7 @@ static int transform_16x16_lumadc(DecodingContext_t *dc, const int c[4][4], int
821829
* From 'ITU-T H.264' recommendation:
822830
* 8.5.11 Scaling and transformation process for chroma DC transform coefficients.
823831
*
824-
* Note: For DC coefficients, the quantization is done after the idct.
832+
* Note: For DC coefficients, the quantization is done after the IDCT.
825833
*/
826834
static int transform_2x2_chromadc(DecodingContext_t *dc, const int YCbCr,
827835
const int c[2][2], int dcC[2][2])
@@ -867,7 +875,7 @@ static int transform_2x2_chromadc(DecodingContext_t *dc, const int YCbCr,
867875
* From 'ITU-T H.264' recommendation:
868876
* 8.5.11 Scaling and transformation process for chroma DC transform coefficients.
869877
*
870-
* Note: For DC coefficients, the quantization is done after the idct.
878+
* Note: For DC coefficients, the quantization is done after the IDCT.
871879
*/
872880
static int transform_4x4_chromadc(DecodingContext_t *dc, const int YCbCr,
873881
const int c[4][4], int dcC[4][4])

minivideo/src/depacketizer/depack.h

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "depack_struct.h"
2929
#include "../bitstream.h"
3030

31+
#include <vector>
32+
3133
/* ************************************************************************** */
3234

3335
minivideo_EXPORT unsigned depack_sample(MediaFile_t *media,

0 commit comments

Comments
 (0)