mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 19:47:32 +09:00
aom: update libaom to 0ec86ac7ae1e32a7e70410fa4972a655ec3670a4
This commit is contained in:
parent
bc3f20e378
commit
eb361970c5
438 changed files with 52661 additions and 21905 deletions
23
third_party/aom/av1/common/obu_util.c
vendored
23
third_party/aom/av1/common/obu_util.c
vendored
|
|
@ -8,6 +8,8 @@
|
|||
* Media Patent License 1.0 was not distributed with this source code in the
|
||||
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
|
||||
*/
|
||||
#include <assert.h>
|
||||
|
||||
#include "av1/common/obu_util.h"
|
||||
|
||||
#include "aom_dsp/bitreader_buffer.h"
|
||||
|
|
@ -112,36 +114,41 @@ aom_codec_err_t aom_read_obu_header_and_size(const uint8_t *data,
|
|||
ObuHeader *obu_header,
|
||||
size_t *const payload_size,
|
||||
size_t *const bytes_read) {
|
||||
size_t length_field_size = 0, obu_size = 0;
|
||||
size_t length_field_size_obu = 0;
|
||||
size_t length_field_size_payload = 0;
|
||||
size_t obu_size = 0;
|
||||
aom_codec_err_t status;
|
||||
|
||||
if (is_annexb) {
|
||||
// Size field comes before the OBU header, and includes the OBU header
|
||||
status =
|
||||
read_obu_size(data, bytes_available, &obu_size, &length_field_size);
|
||||
read_obu_size(data, bytes_available, &obu_size, &length_field_size_obu);
|
||||
|
||||
if (status != AOM_CODEC_OK) return status;
|
||||
}
|
||||
|
||||
struct aom_read_bit_buffer rb = { data + length_field_size,
|
||||
struct aom_read_bit_buffer rb = { data + length_field_size_obu,
|
||||
data + bytes_available, 0, NULL, NULL };
|
||||
|
||||
status = read_obu_header(&rb, is_annexb, obu_header);
|
||||
if (status != AOM_CODEC_OK) return status;
|
||||
|
||||
if (is_annexb) {
|
||||
if (!obu_header->has_size_field) {
|
||||
assert(is_annexb);
|
||||
// Derive the payload size from the data we've already read
|
||||
if (obu_size < obu_header->size) return AOM_CODEC_CORRUPT_FRAME;
|
||||
|
||||
*payload_size = obu_size - obu_header->size;
|
||||
} else {
|
||||
// Size field comes after the OBU header, and is just the payload size
|
||||
status = read_obu_size(data + obu_header->size,
|
||||
bytes_available - obu_header->size, payload_size,
|
||||
&length_field_size);
|
||||
status = read_obu_size(
|
||||
data + length_field_size_obu + obu_header->size,
|
||||
bytes_available - length_field_size_obu - obu_header->size,
|
||||
payload_size, &length_field_size_payload);
|
||||
if (status != AOM_CODEC_OK) return status;
|
||||
}
|
||||
|
||||
*bytes_read = length_field_size + obu_header->size;
|
||||
*bytes_read =
|
||||
length_field_size_obu + obu_header->size + length_field_size_payload;
|
||||
return AOM_CODEC_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue