mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Derive previousNumDeltaPocs from numNegativePics and numPositivePics
This more closely matches the equations in equations 7-61 and 7-62 in See H.265/HEVC (2014) section 7.4.8.
This commit is contained in:
parent
a65b5a5c2b
commit
75d81c7630
@ -417,7 +417,7 @@ public final class H265Reader implements ElementaryStreamReader {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the number of short term reference picture sets in a SPS as ue(v), then skips all of
|
* Reads the number of short term reference picture sets in a SPS as ue(v), then skips all of
|
||||||
* them. See H.265/HEVC (2014) 7.3.7.
|
* them. See H.265/HEVC (2014) 7.3.7 and 7.4.8.
|
||||||
*/
|
*/
|
||||||
private static void skipShortTermRefPicSets(ParsableNalUnitBitArray bitArray) {
|
private static void skipShortTermRefPicSets(ParsableNalUnitBitArray bitArray) {
|
||||||
int numShortTermRefPicSets = bitArray.readUnsignedExpGolombCodedInt();
|
int numShortTermRefPicSets = bitArray.readUnsignedExpGolombCodedInt();
|
||||||
@ -433,21 +433,27 @@ public final class H265Reader implements ElementaryStreamReader {
|
|||||||
interRefPicSetPredictionFlag = bitArray.readBit();
|
interRefPicSetPredictionFlag = bitArray.readBit();
|
||||||
}
|
}
|
||||||
if (interRefPicSetPredictionFlag) {
|
if (interRefPicSetPredictionFlag) {
|
||||||
bitArray.skipBit(); // delta_rps_sign
|
boolean deltaRpsSign = bitArray.readBit(); // delta_rps_sign
|
||||||
bitArray.readUnsignedExpGolombCodedInt(); // abs_delta_rps_minus1
|
bitArray.readUnsignedExpGolombCodedInt(); // abs_delta_rps_minus1
|
||||||
int numDeltaPocs = 0;
|
numNegativePics = 0;
|
||||||
|
numPositivePics = 0;
|
||||||
for (int j = 0; j <= previousNumDeltaPocs; j++) {
|
for (int j = 0; j <= previousNumDeltaPocs; j++) {
|
||||||
if (!bitArray.readBit()) { // used_by_curr_pic_flag[j]
|
if (!bitArray.readBit()) { // used_by_curr_pic_flag[j]
|
||||||
if(!bitArray.readBit()) // use_delta_flag[j]
|
if (bitArray.readBit()) { // use_delta_flag[j]
|
||||||
continue; // if not use_delta_flag, skip increase numDeltaPocs
|
if (deltaRpsSign) {
|
||||||
|
// See H.265/HEVC (2014) section 7.4.8 equation 7-61
|
||||||
|
numNegativePics++;
|
||||||
|
} else {
|
||||||
|
// See H.265/HEVC (2014) section 7.4.8 equation 7-62
|
||||||
|
numPositivePics++;
|
||||||
}
|
}
|
||||||
numDeltaPocs++;
|
|
||||||
}
|
}
|
||||||
previousNumDeltaPocs = numDeltaPocs;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
numNegativePics = bitArray.readUnsignedExpGolombCodedInt();
|
numNegativePics = bitArray.readUnsignedExpGolombCodedInt();
|
||||||
numPositivePics = bitArray.readUnsignedExpGolombCodedInt();
|
numPositivePics = bitArray.readUnsignedExpGolombCodedInt();
|
||||||
previousNumDeltaPocs = numNegativePics + numPositivePics;
|
|
||||||
for (int i = 0; i < numNegativePics; i++) {
|
for (int i = 0; i < numNegativePics; i++) {
|
||||||
bitArray.readUnsignedExpGolombCodedInt(); // delta_poc_s0_minus1[i]
|
bitArray.readUnsignedExpGolombCodedInt(); // delta_poc_s0_minus1[i]
|
||||||
bitArray.skipBit(); // used_by_curr_pic_s0_flag[i]
|
bitArray.skipBit(); // used_by_curr_pic_s0_flag[i]
|
||||||
@ -457,6 +463,8 @@ public final class H265Reader implements ElementaryStreamReader {
|
|||||||
bitArray.skipBit(); // used_by_curr_pic_s1_flag[i]
|
bitArray.skipBit(); // used_by_curr_pic_s1_flag[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// See H.265/HEVC (2014) section 7.4.8 equation 7-71
|
||||||
|
previousNumDeltaPocs = numNegativePics + numPositivePics;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ track 256:
|
|||||||
codecs = hvc1.1.6.L63.90
|
codecs = hvc1.1.6.L63.90
|
||||||
width = 914
|
width = 914
|
||||||
height = 686
|
height = 686
|
||||||
pixelWidthHeightRatio = 1.0003651
|
|
||||||
initializationData:
|
initializationData:
|
||||||
data = length 146, hash 61554FEF
|
data = length 146, hash 61554FEF
|
||||||
sample 0:
|
sample 0:
|
||||||
|
@ -15,7 +15,6 @@ track 256:
|
|||||||
codecs = hvc1.1.6.L63.90
|
codecs = hvc1.1.6.L63.90
|
||||||
width = 914
|
width = 914
|
||||||
height = 686
|
height = 686
|
||||||
pixelWidthHeightRatio = 1.0003651
|
|
||||||
initializationData:
|
initializationData:
|
||||||
data = length 146, hash 61554FEF
|
data = length 146, hash 61554FEF
|
||||||
sample 0:
|
sample 0:
|
||||||
|
@ -15,7 +15,6 @@ track 256:
|
|||||||
codecs = hvc1.1.6.L63.90
|
codecs = hvc1.1.6.L63.90
|
||||||
width = 914
|
width = 914
|
||||||
height = 686
|
height = 686
|
||||||
pixelWidthHeightRatio = 1.0003651
|
|
||||||
initializationData:
|
initializationData:
|
||||||
data = length 146, hash 61554FEF
|
data = length 146, hash 61554FEF
|
||||||
sample 0:
|
sample 0:
|
||||||
|
@ -15,7 +15,6 @@ track 256:
|
|||||||
codecs = hvc1.1.6.L63.90
|
codecs = hvc1.1.6.L63.90
|
||||||
width = 914
|
width = 914
|
||||||
height = 686
|
height = 686
|
||||||
pixelWidthHeightRatio = 1.0003651
|
|
||||||
initializationData:
|
initializationData:
|
||||||
data = length 146, hash 61554FEF
|
data = length 146, hash 61554FEF
|
||||||
sample 0:
|
sample 0:
|
||||||
|
@ -12,7 +12,6 @@ track 256:
|
|||||||
codecs = hvc1.1.6.L63.90
|
codecs = hvc1.1.6.L63.90
|
||||||
width = 914
|
width = 914
|
||||||
height = 686
|
height = 686
|
||||||
pixelWidthHeightRatio = 1.0003651
|
|
||||||
initializationData:
|
initializationData:
|
||||||
data = length 146, hash 61554FEF
|
data = length 146, hash 61554FEF
|
||||||
sample 0:
|
sample 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user