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 4066970ce7292642794f4a3954f8d0fde78dd310)
This commit is contained in:
rohks 2022-11-24 18:14:44 +00:00 committed by christosts
parent 5ebbdc52cb
commit 30dce91fc0
31 changed files with 42 additions and 42 deletions

View File

@ -162,7 +162,7 @@ public final class Ac3Util {
channelCount++; channelCount++;
} }
int halfFrmsizecod = dataBitArray.readBits(5); // bit_rate_code 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 // Update data position
dataBitArray.byteAlign(); dataBitArray.byteAlign();
data.setPosition(dataBitArray.getBytePosition()); data.setPosition(dataBitArray.getBytePosition());
@ -193,7 +193,7 @@ public final class Ac3Util {
ParsableBitArray dataBitArray = new ParsableBitArray(); ParsableBitArray dataBitArray = new ParsableBitArray();
dataBitArray.reset(data); dataBitArray.reset(data);
int peakBitrate = dataBitArray.readBits(13); // data_rate int peakBitrate = dataBitArray.readBits(13) * 1000; // data_rate
dataBitArray.skipBits(3); // num_ind_sub dataBitArray.skipBits(3); // num_ind_sub
// Read the first independent substream. // Read the first independent substream.

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 13824 total output bytes = 13824
sample count = 9 sample count = 9
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = 1566 maxInputSize = 1566

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 9216 total output bytes = 9216
sample count = 6 sample count = 6
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = 1566 maxInputSize = 1566

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 4608 total output bytes = 4608
sample count = 3 sample count = 3
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = 1566 maxInputSize = 1566

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 1536 total output bytes = 1536
sample count = 1 sample count = 1
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = 1566 maxInputSize = 1566

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 13824 total output bytes = 13824
sample count = 9 sample count = 9
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = 1566 maxInputSize = 1566

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 13824 total output bytes = 13824
sample count = 9 sample count = 9
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
channelCount = 6 channelCount = 6

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 10752 total output bytes = 10752
sample count = 7 sample count = 7
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
channelCount = 6 channelCount = 6

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 6144 total output bytes = 6144
sample count = 4 sample count = 4
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
channelCount = 6 channelCount = 6

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 1536 total output bytes = 1536
sample count = 1 sample count = 1
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
channelCount = 6 channelCount = 6

View File

@ -10,8 +10,8 @@ track 0:
total output bytes = 13824 total output bytes = 13824
sample count = 9 sample count = 9
format 0: format 0:
averageBitrate = 384 averageBitrate = 384000
peakBitrate = 384 peakBitrate = 384000
id = 1 id = 1
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 216000 total output bytes = 216000
sample count = 54 sample count = 54
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
maxInputSize = 4030 maxInputSize = 4030

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 144000 total output bytes = 144000
sample count = 36 sample count = 36
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
maxInputSize = 4030 maxInputSize = 4030

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 72000 total output bytes = 72000
sample count = 18 sample count = 18
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
maxInputSize = 4030 maxInputSize = 4030

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 4000 total output bytes = 4000
sample count = 1 sample count = 1
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
maxInputSize = 4030 maxInputSize = 4030

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 216000 total output bytes = 216000
sample count = 54 sample count = 54
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
maxInputSize = 4030 maxInputSize = 4030

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 216000 total output bytes = 216000
sample count = 54 sample count = 54
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 148000 total output bytes = 148000
sample count = 37 sample count = 37
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 76000 total output bytes = 76000
sample count = 19 sample count = 19
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 4000 total output bytes = 4000
sample count = 1 sample count = 1
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 216000 total output bytes = 216000
sample count = 54 sample count = 54
format 0: format 0:
peakBitrate = 1000 peakBitrate = 1000000
id = 1 id = 1
sampleMimeType = audio/eac3 sampleMimeType = audio/eac3
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 163840 total output bytes = 163840
sample count = 64 sample count = 64
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
maxInputSize = 2590 maxInputSize = 2590

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 110080 total output bytes = 110080
sample count = 43 sample count = 43
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
maxInputSize = 2590 maxInputSize = 2590

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 56320 total output bytes = 56320
sample count = 22 sample count = 22
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
maxInputSize = 2590 maxInputSize = 2590

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 2560 total output bytes = 2560
sample count = 1 sample count = 1
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
maxInputSize = 2590 maxInputSize = 2590

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 163840 total output bytes = 163840
sample count = 64 sample count = 64
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
maxInputSize = 2590 maxInputSize = 2590

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 163840 total output bytes = 163840
sample count = 64 sample count = 64
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 110080 total output bytes = 110080
sample count = 43 sample count = 43
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 56320 total output bytes = 56320
sample count = 22 sample count = 22
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 2560 total output bytes = 2560
sample count = 1 sample count = 1
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
channelCount = 6 channelCount = 6

View File

@ -10,7 +10,7 @@ track 0:
total output bytes = 163840 total output bytes = 163840
sample count = 64 sample count = 64
format 0: format 0:
peakBitrate = 640 peakBitrate = 640000
id = 1 id = 1
sampleMimeType = audio/eac3-joc sampleMimeType = audio/eac3-joc
channelCount = 6 channelCount = 6