1 /* 2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 * 4 * This source code is subject to the terms of the BSD 2 Clause License and 5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 * was not distributed with this source code in the LICENSE file, you can 7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 * Media Patent License 1.0 was not distributed with this source code in the 9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 */ 11 12 #ifndef AOM_AV1_DECODER_DECODEFRAME_H_ 13 #define AOM_AV1_DECODER_DECODEFRAME_H_ 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 struct AV1Decoder; 20 struct aom_read_bit_buffer; 21 struct ThreadData; 22 23 // Reads the middle part of the sequence header OBU (from 24 // frame_width_bits_minus_1 to enable_restoration) into seq_params. 25 // Reports errors by calling rb->error_handler() or aom_internal_error(). 26 void av1_read_sequence_header(AV1_COMMON *cm, struct aom_read_bit_buffer *rb, 27 SequenceHeader *seq_params); 28 29 void av1_read_frame_size(struct aom_read_bit_buffer *rb, int num_bits_width, 30 int num_bits_height, int *width, int *height); 31 BITSTREAM_PROFILE av1_read_profile(struct aom_read_bit_buffer *rb); 32 33 // Returns 0 on success. Sets pbi->common.error.error_code and returns -1 on 34 // failure. 35 int av1_check_trailing_bits(struct AV1Decoder *pbi, 36 struct aom_read_bit_buffer *rb); 37 38 // On success, returns the frame header size. On failure, calls 39 // aom_internal_error and does not return. 40 uint32_t av1_decode_frame_headers_and_setup(struct AV1Decoder *pbi, 41 struct aom_read_bit_buffer *rb, 42 int trailing_bits_present); 43 44 void av1_decode_tg_tiles_and_wrapup(struct AV1Decoder *pbi, const uint8_t *data, 45 const uint8_t *data_end, 46 const uint8_t **p_data_end, int start_tile, 47 int end_tile, int initialize_flag); 48 49 // Implements the color_config() function in the spec. Reports errors by 50 // calling rb->error_handler() or aom_internal_error(). 51 void av1_read_color_config(struct aom_read_bit_buffer *rb, 52 int allow_lowbitdepth, SequenceHeader *seq_params, 53 struct aom_internal_error_info *error_info); 54 55 // Implements the timing_info() function in the spec. Reports errors by calling 56 // rb->error_handler() or aom_internal_error(). 57 void av1_read_timing_info_header(aom_timing_info_t *timing_info, 58 struct aom_internal_error_info *error, 59 struct aom_read_bit_buffer *rb); 60 61 // Implements the decoder_model_info() function in the spec. Reports errors by 62 // calling rb->error_handler(). 63 void av1_read_decoder_model_info(aom_dec_model_info_t *decoder_model_info, 64 struct aom_read_bit_buffer *rb); 65 66 // Implements the operating_parameters_info() function in the spec. Reports 67 // errors by calling rb->error_handler(). 68 void av1_read_op_parameters_info(aom_dec_model_op_parameters_t *op_params, 69 int buffer_delay_length, 70 struct aom_read_bit_buffer *rb); 71 72 struct aom_read_bit_buffer *av1_init_read_bit_buffer( 73 struct AV1Decoder *pbi, struct aom_read_bit_buffer *rb, const uint8_t *data, 74 const uint8_t *data_end); 75 76 void av1_free_mc_tmp_buf(struct ThreadData *thread_data); 77 78 void av1_set_single_tile_decoding_mode(AV1_COMMON *const cm); 79 80 #ifdef __cplusplus 81 } // extern "C" 82 #endif 83 84 #endif // AOM_AV1_DECODER_DECODEFRAME_H_ 85