From 68569dee1416593955c1570d638b3d9250b33012 Mon Sep 17 00:00:00 2001 From: trav90 Date: Mon, 15 Oct 2018 21:45:30 -0500 Subject: Import aom library This is the reference implementation for the Alliance for Open Media's av1 video code. The commit used was 4d668d7feb1f8abd809d1bca0418570a7f142a36. --- third_party/aom/av1/encoder/bitstream.h | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 third_party/aom/av1/encoder/bitstream.h (limited to 'third_party/aom/av1/encoder/bitstream.h') diff --git a/third_party/aom/av1/encoder/bitstream.h b/third_party/aom/av1/encoder/bitstream.h new file mode 100644 index 000000000..c75d80891 --- /dev/null +++ b/third_party/aom/av1/encoder/bitstream.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2016, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * 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. + */ + +#ifndef AV1_ENCODER_BITSTREAM_H_ +#define AV1_ENCODER_BITSTREAM_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "av1/encoder/encoder.h" + +#if CONFIG_REFERENCE_BUFFER +void write_sequence_header(SequenceHeader *seq_params); +#endif + +void av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size); + +void av1_encode_token_init(void); + +static INLINE int av1_preserve_existing_gf(AV1_COMP *cpi) { +#if CONFIG_EXT_REFS + // Do not swap gf and arf indices for internal overlay frames + return !cpi->multi_arf_allowed && cpi->rc.is_src_frame_alt_ref && + !cpi->rc.is_src_frame_ext_arf; +#else + return !cpi->multi_arf_allowed && cpi->refresh_golden_frame && + cpi->rc.is_src_frame_alt_ref; +#endif // CONFIG_EXT_REFS +} + +void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd, +#if CONFIG_SUPERTX + const int supertx_enabled, +#endif +#if CONFIG_TXK_SEL + int block, int plane, +#endif + aom_writer *w); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // AV1_ENCODER_BITSTREAM_H_ -- cgit v1.2.3 From 7369c7d7a5eed32963d8af37658286617919f91c Mon Sep 17 00:00:00 2001 From: trav90 Date: Thu, 18 Oct 2018 06:04:57 -0500 Subject: Update aom to commit id f5bdeac22930ff4c6b219be49c843db35970b918 --- third_party/aom/av1/encoder/bitstream.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'third_party/aom/av1/encoder/bitstream.h') diff --git a/third_party/aom/av1/encoder/bitstream.h b/third_party/aom/av1/encoder/bitstream.h index c75d80891..29c930356 100644 --- a/third_party/aom/av1/encoder/bitstream.h +++ b/third_party/aom/av1/encoder/bitstream.h @@ -19,7 +19,11 @@ extern "C" { #include "av1/encoder/encoder.h" #if CONFIG_REFERENCE_BUFFER -void write_sequence_header(SequenceHeader *seq_params); +void write_sequence_header( +#if CONFIG_EXT_TILE + AV1_COMMON *const cm, +#endif // CONFIG_EXT_TILE + SequenceHeader *seq_params); #endif void av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size); @@ -42,7 +46,8 @@ void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd, const int supertx_enabled, #endif #if CONFIG_TXK_SEL - int block, int plane, + int blk_row, int blk_col, int block, int plane, + TX_SIZE tx_size, #endif aom_writer *w); -- cgit v1.2.3 From ec910d81405c736a4490383a250299a7837c2e64 Mon Sep 17 00:00:00 2001 From: trav90 Date: Thu, 18 Oct 2018 21:53:44 -0500 Subject: Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614 --- third_party/aom/av1/encoder/bitstream.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'third_party/aom/av1/encoder/bitstream.h') diff --git a/third_party/aom/av1/encoder/bitstream.h b/third_party/aom/av1/encoder/bitstream.h index 29c930356..76eb85116 100644 --- a/third_party/aom/av1/encoder/bitstream.h +++ b/third_party/aom/av1/encoder/bitstream.h @@ -18,12 +18,11 @@ extern "C" { #include "av1/encoder/encoder.h" +struct aom_write_bit_buffer; + #if CONFIG_REFERENCE_BUFFER -void write_sequence_header( -#if CONFIG_EXT_TILE - AV1_COMMON *const cm, -#endif // CONFIG_EXT_TILE - SequenceHeader *seq_params); +void write_sequence_header(AV1_COMMON *const cm, + struct aom_write_bit_buffer *wb); #endif void av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size); -- cgit v1.2.3 From bbcc64772580c8a979288791afa02d30bc476d2e Mon Sep 17 00:00:00 2001 From: trav90 Date: Fri, 19 Oct 2018 21:52:15 -0500 Subject: Update aom to v1.0.0 Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0. --- third_party/aom/av1/encoder/bitstream.h | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'third_party/aom/av1/encoder/bitstream.h') diff --git a/third_party/aom/av1/encoder/bitstream.h b/third_party/aom/av1/encoder/bitstream.h index 76eb85116..2047b6833 100644 --- a/third_party/aom/av1/encoder/bitstream.h +++ b/third_party/aom/av1/encoder/bitstream.h @@ -20,34 +20,24 @@ extern "C" { struct aom_write_bit_buffer; -#if CONFIG_REFERENCE_BUFFER -void write_sequence_header(AV1_COMMON *const cm, - struct aom_write_bit_buffer *wb); -#endif +void write_sequence_header(AV1_COMP *cpi, struct aom_write_bit_buffer *wb); + +uint32_t write_obu_header(OBU_TYPE obu_type, int obu_extension, + uint8_t *const dst); -void av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size); +int write_uleb_obu_size(uint32_t obu_header_size, uint32_t obu_payload_size, + uint8_t *dest); -void av1_encode_token_init(void); +int av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size); static INLINE int av1_preserve_existing_gf(AV1_COMP *cpi) { -#if CONFIG_EXT_REFS // Do not swap gf and arf indices for internal overlay frames return !cpi->multi_arf_allowed && cpi->rc.is_src_frame_alt_ref && !cpi->rc.is_src_frame_ext_arf; -#else - return !cpi->multi_arf_allowed && cpi->refresh_golden_frame && - cpi->rc.is_src_frame_alt_ref; -#endif // CONFIG_EXT_REFS } void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd, -#if CONFIG_SUPERTX - const int supertx_enabled, -#endif -#if CONFIG_TXK_SEL - int blk_row, int blk_col, int block, int plane, - TX_SIZE tx_size, -#endif + int blk_row, int blk_col, int plane, TX_SIZE tx_size, aom_writer *w); #ifdef __cplusplus -- cgit v1.2.3 From d2499ead93dc4298c0882fe98902acb1b5209f99 Mon Sep 17 00:00:00 2001 From: trav90 Date: Fri, 19 Oct 2018 23:05:00 -0500 Subject: Update libaom to commit ID 1e227d41f0616de9548a673a83a21ef990b62591 --- third_party/aom/av1/encoder/bitstream.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'third_party/aom/av1/encoder/bitstream.h') diff --git a/third_party/aom/av1/encoder/bitstream.h b/third_party/aom/av1/encoder/bitstream.h index 2047b6833..465ccaed5 100644 --- a/third_party/aom/av1/encoder/bitstream.h +++ b/third_party/aom/av1/encoder/bitstream.h @@ -9,8 +9,8 @@ * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ -#ifndef AV1_ENCODER_BITSTREAM_H_ -#define AV1_ENCODER_BITSTREAM_H_ +#ifndef AOM_AV1_ENCODER_BITSTREAM_H_ +#define AOM_AV1_ENCODER_BITSTREAM_H_ #ifdef __cplusplus extern "C" { @@ -20,8 +20,13 @@ extern "C" { struct aom_write_bit_buffer; -void write_sequence_header(AV1_COMP *cpi, struct aom_write_bit_buffer *wb); +// Writes only the OBU Sequence Header payload, and returns the size of the +// payload written to 'dst'. This function does not write the OBU header, the +// optional extension, or the OBU size to 'dst'. +uint32_t write_sequence_header_obu(AV1_COMP *cpi, uint8_t *const dst); +// Writes the OBU header byte, and the OBU header extension byte when +// 'obu_extension' is non-zero. Returns number of bytes written to 'dst'. uint32_t write_obu_header(OBU_TYPE obu_type, int obu_extension, uint8_t *const dst); @@ -32,8 +37,7 @@ int av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size); static INLINE int av1_preserve_existing_gf(AV1_COMP *cpi) { // Do not swap gf and arf indices for internal overlay frames - return !cpi->multi_arf_allowed && cpi->rc.is_src_frame_alt_ref && - !cpi->rc.is_src_frame_ext_arf; + return cpi->rc.is_src_frame_alt_ref && !cpi->rc.is_src_frame_ext_arf; } void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd, @@ -44,4 +48,4 @@ void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd, } // extern "C" #endif -#endif // AV1_ENCODER_BITSTREAM_H_ +#endif // AOM_AV1_ENCODER_BITSTREAM_H_ -- cgit v1.2.3