Skip to content

Commit fae901f

Browse files
committed
minivideo: minor cleanups
1 parent 5c705b5 commit fae901f

15 files changed

+143
-145
lines changed

minivideo/src/bitstream_map.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static void computeSamplesDatasTrack(MediaStream_t *track)
429429
// Set gross bitrate value (in bps)
430430
if (track->bitrate_avg == 0 && track->stream_duration_ms != 0)
431431
{
432-
track->bitrate_avg = (unsigned int)round(((double)track->stream_size / (double)(track->stream_duration_ms)));
432+
track->bitrate_avg = (unsigned)round(((double)track->stream_size / (double)(track->stream_duration_ms)));
433433
track->bitrate_avg *= 1000; // ms to s
434434
track->bitrate_avg *= 8; // B to b
435435
}

minivideo/src/bitstream_utils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ void bitstream_print_buffer(Bitstream_t *bitstr)
6262
{
6363
TRACE_1(BITS, "<b> " BLD_BLUE "bitstream_print_buffer()" CLR_RESET);
6464

65-
unsigned int i = 0, j = 0;
66-
unsigned int row = 21, line = 16;
65+
unsigned i = 0, j = 0;
66+
unsigned row = 21, line = 16;
6767

6868
while (i < (bitstr->buffer_size/row))
6969
{

minivideo/src/decoder/h264/h264_parameterset.cpp

+11-12
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ int decodeSPS(Bitstream_t *bitstr, h264_sps_t *sps)
454454
sps->vui_parameters_present_flag = read_bit(bitstr);
455455
if (sps->vui_parameters_present_flag)
456456
{
457-
// Decode VUI
458457
sps->vui = decodeVUI(bitstr);
459458
}
460459

@@ -687,7 +686,7 @@ void printSPS(h264_sps_t *sps)
687686
#if ENABLE_DEBUG
688687
TRACE_INFO(PARAM, "> " BLD_GREEN "printSPS()" CLR_RESET);
689688

690-
unsigned int i = 0;
689+
unsigned i = 0;
691690

692691
// Check SPS structure
693692
if (sps == NULL)
@@ -1144,7 +1143,7 @@ void printPPS(h264_pps_t *pps, h264_sps_t **sps_array)
11441143
#if ENABLE_DEBUG
11451144
TRACE_INFO(PARAM, "> " BLD_GREEN "printPPS()" CLR_RESET);
11461145

1147-
unsigned int i = 0;
1146+
unsigned i = 0;
11481147

11491148
// Check PPS structure
11501149
if (pps == NULL)
@@ -1161,7 +1160,7 @@ void printPPS(h264_pps_t *pps, h264_sps_t **sps_array)
11611160
TRACE_1(PARAM, " - num_slice_groups_minus1 = %i", pps->num_slice_groups_minus1);
11621161
if (pps->num_slice_groups_minus1 > 0)
11631162
{
1164-
unsigned int iGroup = 0;
1163+
unsigned iGroup = 0;
11651164
TRACE_1(PARAM, " - slice_group_map_type = %i", pps->slice_group_map_type);
11661165
if (pps->slice_group_map_type == 0)
11671166
{
@@ -1399,25 +1398,25 @@ int decodeSEI(Bitstream_t *bitstr, h264_sei_t *sei, int64_t size)
13991398
while (currentpos < (startpos + size))
14001399
{
14011400
// SEI payload header
1402-
unsigned int payloadType = 0;
1403-
unsigned int payloadSize = 0;
1401+
unsigned payloadType = 0;
1402+
unsigned payloadSize = 0;
14041403

14051404
while (next_bits(bitstr, 8) == 0xFF)
14061405
{
1407-
unsigned int ff_byte = read_bits(bitstr, 8); // equal to 0xFF
1406+
/*unsigned ff_byte =*/ read_bits(bitstr, 8); // equal to 0xFF
14081407
payloadType += 255;
14091408
}
14101409

1411-
unsigned int last_payload_type_byte = read_bits(bitstr, 8);
1410+
unsigned last_payload_type_byte = read_bits(bitstr, 8);
14121411
payloadType += last_payload_type_byte;
14131412

14141413
while (next_bits(bitstr, 8) == 0xFF)
14151414
{
1416-
unsigned int ff_byte = read_bits(bitstr, 8); // equal to 0xFF
1415+
/*unsigned ff_byte =*/ read_bits(bitstr, 8); // equal to 0xFF
14171416
payloadSize += 255;
14181417
}
14191418

1420-
unsigned int last_payload_size_byte = read_bits(bitstr, 8);
1419+
unsigned last_payload_size_byte = read_bits(bitstr, 8);
14211420
payloadSize += last_payload_size_byte;
14221421

14231422
// SEI payload
@@ -1684,7 +1683,7 @@ static int checkVUI(h264_vui_t *vui, h264_sps_t *sps)
16841683
{
16851684
if (vui->aspect_ratio_idc == 255) // 255 : Extended_SAR
16861685
{
1687-
if (is_prime(vui->sar_width) == 0)
1686+
if (!is_prime(vui->sar_width))
16881687
{
16891688
if (vui->sar_width != 0)
16901689
{
@@ -1693,7 +1692,7 @@ static int checkVUI(h264_vui_t *vui, h264_sps_t *sps)
16931692
}
16941693
}
16951694

1696-
if (is_prime(vui->sar_height) == 0)
1695+
if (!is_prime(vui->sar_height))
16971696
{
16981697
if (vui->sar_height != 0)
16991698
{

0 commit comments

Comments
 (0)