Commit 7e733aa2 by rohks Committed by christosts

Convert bitrates to bps before setting it

Format expects the values of `averageBitrate` and `peakBitrate` in bps and the value fetched from AC3SpecificBox and EC3SpecificBox is in kbps.

PiperOrigin-RevId: 490756581
(cherry picked from commit 67955e0c)
parent 062f0e3d
Showing with 42 additions and 42 deletions
......@@ -160,7 +160,7 @@ public final class Ac3Util {
channelCount++;
}
int halfFrmsizecod = dataBitArray.readBits(5); // bit_rate_code
int constantBitrate = BITRATE_BY_HALF_FRMSIZECOD[halfFrmsizecod];
int constantBitrate = BITRATE_BY_HALF_FRMSIZECOD[halfFrmsizecod] * 1000;
// Update data position
dataBitArray.byteAlign();
data.setPosition(dataBitArray.getBytePosition());
......@@ -191,7 +191,7 @@ public final class Ac3Util {
ParsableBitArray dataBitArray = new ParsableBitArray();
dataBitArray.reset(data);
int peakBitrate = dataBitArray.readBits(13); // data_rate
int peakBitrate = dataBitArray.readBits(13) * 1000; // data_rate
dataBitArray.skipBits(3); // num_ind_sub
// Read the first independent substream.
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 13824
sample count = 9
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
maxInputSize = 1566
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 9216
sample count = 6
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
maxInputSize = 1566
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 4608
sample count = 3
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
maxInputSize = 1566
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 1536
sample count = 1
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
maxInputSize = 1566
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 13824
sample count = 9
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
maxInputSize = 1566
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 13824
sample count = 9
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
channelCount = 6
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 10752
sample count = 7
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
channelCount = 6
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 6144
sample count = 4
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
channelCount = 6
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 1536
sample count = 1
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
channelCount = 6
......
......@@ -10,8 +10,8 @@ track 0:
total output bytes = 13824
sample count = 9
format 0:
averageBitrate = 384
peakBitrate = 384
averageBitrate = 384000
peakBitrate = 384000
id = 1
sampleMimeType = audio/ac3
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 216000
sample count = 54
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
maxInputSize = 4030
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 144000
sample count = 36
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
maxInputSize = 4030
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 72000
sample count = 18
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
maxInputSize = 4030
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 4000
sample count = 1
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
maxInputSize = 4030
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 216000
sample count = 54
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
maxInputSize = 4030
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 216000
sample count = 54
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 148000
sample count = 37
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 76000
sample count = 19
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 4000
sample count = 1
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 216000
sample count = 54
format 0:
peakBitrate = 1000
peakBitrate = 1000000
id = 1
sampleMimeType = audio/eac3
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 163840
sample count = 64
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
maxInputSize = 2590
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 110080
sample count = 43
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
maxInputSize = 2590
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 56320
sample count = 22
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
maxInputSize = 2590
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 2560
sample count = 1
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
maxInputSize = 2590
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 163840
sample count = 64
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
maxInputSize = 2590
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 163840
sample count = 64
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 110080
sample count = 43
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 56320
sample count = 22
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 2560
sample count = 1
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
channelCount = 6
......
......@@ -10,7 +10,7 @@ track 0:
total output bytes = 163840
sample count = 64
format 0:
peakBitrate = 640
peakBitrate = 640000
id = 1
sampleMimeType = audio/eac3-joc
channelCount = 6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment