Skip to content

Commit

Permalink
Format files and add release note
Browse files Browse the repository at this point in the history
  • Loading branch information
microkatz committed Oct 24, 2023
1 parent 265a548 commit a2177f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* Add support for flattening H.265/HEVC SEF slow motion videos.
* Track Selection:
* Extractors:
* Add AV1C parsing to MP4 extractor
([#692](https://github.com/androidx/media/pull/692)).
* Audio:
* Video:
* Add workaround for a device issue on Galaxy Tab S7 FE, Chromecast with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1243,9 +1243,8 @@ private static void parseVideoSampleEntry(
Av1BitstreamParser parser = new Av1BitstreamParser(parent);
if (parser.parseSequenceHeader() && parser.colorDescriptionPresentFlag == 1) {
colorSpace = ColorInfo.isoColorPrimariesToColorSpace(parser.colorPrimaries);
colorTransfer = ColorInfo.isoTransferCharacteristicsToColorTransfer(
parser.transferCharacteristics
);
colorTransfer =
ColorInfo.isoTransferCharacteristicsToColorTransfer(parser.transferCharacteristics);
colorRange = (parser.colorRange == 1) ? C.COLOR_RANGE_FULL : C.COLOR_RANGE_LIMITED;
}
} else if (childAtomType == Atom.TYPE_clli) {
Expand Down Expand Up @@ -2185,7 +2184,7 @@ public int readNextSampleSize() {
/**
* Helper class for parsing syntax elements from AV1 bitstream.
*
* Bitstream specification: https://aomediacodec.github.io/av1-spec/av1-spec.pdf
* <p>Bitstream specification: https://aomediacodec.github.io/av1-spec/av1-spec.pdf
*/
private static final class Av1BitstreamParser {
private static final String TAG = "Av1BitstreamParser";
Expand All @@ -2208,9 +2207,8 @@ public Av1BitstreamParser(ParsableByteArray data) {
/**
* Parses a fixed-length unsigned number.
*
* See AV1 bitstream spec 4.10.2.
* f(n): Unsigned n-bit number appearing directly in the bitstream.
* The bits are read from high to low order.
* <p>See AV1 bitstream spec 4.10.2. f(n): Unsigned n-bit number appearing directly in the
* bitstream. The bits are read from high to low order.
*
* @param length The length (in bits) of the number to decode.
* @return Parsed unsigned number.
Expand All @@ -2225,17 +2223,15 @@ private int parseF(int length) {
int newBitCount = min(length, bitCount);
bitCount -= newBitCount;
length -= newBitCount;
result = (result << newBitCount) |
((currentByte >> bitCount) & ((1 << newBitCount) - 1));
result = (result << newBitCount) | ((currentByte >> bitCount) & ((1 << newBitCount) - 1));
}
return result;
}

/**
* Parses the AV1 sequence header.
*
* See AV1 bitstream spec 5.5.1.
* This method can only be called once.
* <p>See AV1 bitstream spec 5.5.1. This method can only be called once.
*/
public boolean parseSequenceHeader() {
if (parseSequenceHeaderCalled) {
Expand Down

0 comments on commit a2177f5

Please sign in to comment.