Nathan E. Egge | 20f9ae1 | 2017-03-02 20:13:17 -0500 | [diff] [blame] | 1 | /* |
Krishna Rapaka | 7319db5 | 2021-09-28 20:35:29 -0700 | [diff] [blame] | 2 | * Copyright (c) 2021, Alliance for Open Media. All rights reserved |
Nathan E. Egge | 20f9ae1 | 2017-03-02 20:13:17 -0500 | [diff] [blame] | 3 | * |
Vibhoothi | 41c6dd7 | 2021-10-12 18:48:26 +0000 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 3-Clause Clear License |
| 5 | * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear |
| 6 | * License was not distributed with this source code in the LICENSE file, you |
| 7 | * can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. If the |
| 8 | * Alliance for Open Media Patent License 1.0 was not distributed with this |
| 9 | * source code in the PATENTS file, you can obtain it at |
| 10 | * aomedia.org/license/patent-license/. |
Nathan E. Egge | 20f9ae1 | 2017-03-02 20:13:17 -0500 | [diff] [blame] | 11 | */ |
James Zern | e1cbb13 | 2018-08-22 14:10:36 -0700 | [diff] [blame] | 12 | #ifndef AOM_AV1_DECODER_INSPECTION_H_ |
| 13 | #define AOM_AV1_DECODER_INSPECTION_H_ |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 14 | |
Nathan E. Egge | 74b7338 | 2017-03-02 19:31:44 -0500 | [diff] [blame] | 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif // __cplusplus |
| 18 | |
Yaowu Xu | 6496fe9 | 2017-05-15 16:00:38 -0700 | [diff] [blame] | 19 | #include "av1/common/seg_common.h" |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 20 | #if CONFIG_ACCOUNTING |
Luc Trudeau | 83fbd57 | 2017-04-21 11:24:34 -0400 | [diff] [blame] | 21 | #include "av1/decoder/accounting.h" |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 22 | #endif |
| 23 | |
Jim Bankoski | 8aced4b | 2018-10-01 13:03:41 -0700 | [diff] [blame] | 24 | #ifndef AOM_AOM_AOMDX_H_ |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 25 | typedef void (*aom_inspect_cb)(void *decoder, void *data); |
Yushin Cho | f674157 | 2017-10-24 20:07:46 -0700 | [diff] [blame] | 26 | #endif |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 27 | |
| 28 | typedef struct insp_mv insp_mv; |
| 29 | |
| 30 | struct insp_mv { |
| 31 | int16_t row; |
| 32 | int16_t col; |
| 33 | }; |
| 34 | |
| 35 | typedef struct insp_mi_data insp_mi_data; |
| 36 | |
| 37 | struct insp_mi_data { |
| 38 | insp_mv mv[2]; |
Yushin Cho | c24351c | 2017-10-24 14:59:08 -0700 | [diff] [blame] | 39 | int16_t ref_frame[2]; |
| 40 | int16_t mode; |
| 41 | int16_t uv_mode; |
| 42 | int16_t sb_type; |
| 43 | int16_t skip; |
| 44 | int16_t segment_id; |
Yushin Cho | c24351c | 2017-10-24 14:59:08 -0700 | [diff] [blame] | 45 | int16_t dual_filter_type; |
| 46 | int16_t filter[2]; |
Yushin Cho | c24351c | 2017-10-24 14:59:08 -0700 | [diff] [blame] | 47 | int16_t tx_type; |
| 48 | int16_t tx_size; |
Yushin Cho | c24351c | 2017-10-24 14:59:08 -0700 | [diff] [blame] | 49 | int16_t cdef_level; |
| 50 | int16_t cdef_strength; |
Yushin Cho | c24351c | 2017-10-24 14:59:08 -0700 | [diff] [blame] | 51 | int16_t cfl_alpha_idx; |
| 52 | int16_t cfl_alpha_sign; |
Yushin Cho | c24351c | 2017-10-24 14:59:08 -0700 | [diff] [blame] | 53 | int16_t current_qindex; |
Jim Bankoski | 21b68a0 | 2018-10-19 13:28:25 -0700 | [diff] [blame] | 54 | int16_t compound_type; |
| 55 | int16_t motion_mode; |
Hui Su | 83684e1 | 2019-03-19 12:17:34 -0700 | [diff] [blame] | 56 | int16_t intrabc; |
| 57 | int16_t palette; |
| 58 | int16_t uv_palette; |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | typedef struct insp_frame_data insp_frame_data; |
| 62 | |
| 63 | struct insp_frame_data { |
| 64 | #if CONFIG_ACCOUNTING |
| 65 | Accounting *accounting; |
| 66 | #endif |
| 67 | insp_mi_data *mi_grid; |
Jim Bankoski | 21b68a0 | 2018-10-19 13:28:25 -0700 | [diff] [blame] | 68 | int16_t frame_number; |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 69 | int show_frame; |
| 70 | int frame_type; |
| 71 | int base_qindex; |
| 72 | int mi_rows; |
| 73 | int mi_cols; |
Michael Bebenita | 2c2e561 | 2017-04-06 22:19:04 -0400 | [diff] [blame] | 74 | int tile_mi_rows; |
| 75 | int tile_mi_cols; |
Krishna Rapaka | d6b2b7d | 2022-03-15 17:09:39 -0700 | [diff] [blame] | 76 | |
Ryan Lei | ccc6ea7 | 2021-01-06 11:43:56 -0800 | [diff] [blame] | 77 | int32_t y_dequant[MAX_SEGMENTS][2]; |
| 78 | int32_t u_dequant[MAX_SEGMENTS][2]; |
| 79 | int32_t v_dequant[MAX_SEGMENTS][2]; |
Krishna Rapaka | d6b2b7d | 2022-03-15 17:09:39 -0700 | [diff] [blame] | 80 | |
Frederic Barbier | 1aeee2e | 2017-11-10 17:54:22 +0100 | [diff] [blame] | 81 | // TODO(negge): add per frame CDEF data |
Yushin Cho | c24351c | 2017-10-24 14:59:08 -0700 | [diff] [blame] | 82 | int delta_q_present_flag; |
| 83 | int delta_q_res; |
Jim Bankoski | 3f73287 | 2018-10-29 06:54:18 -0700 | [diff] [blame] | 84 | int show_existing_frame; |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 85 | }; |
| 86 | |
| 87 | void ifd_init(insp_frame_data *fd, int frame_width, int frame_height); |
| 88 | void ifd_clear(insp_frame_data *fd); |
Jim Bankoski | c04ce61 | 2018-12-20 15:45:33 -0800 | [diff] [blame] | 89 | int ifd_inspect(insp_frame_data *fd, void *decoder, int skip_not_transform); |
Nathan E. Egge | 2cf03b1 | 2017-02-22 16:19:59 -0500 | [diff] [blame] | 90 | |
Nathan E. Egge | 74b7338 | 2017-03-02 19:31:44 -0500 | [diff] [blame] | 91 | #ifdef __cplusplus |
| 92 | } // extern "C" |
| 93 | #endif // __cplusplus |
James Zern | e1cbb13 | 2018-08-22 14:10:36 -0700 | [diff] [blame] | 94 | #endif // AOM_AV1_DECODER_INSPECTION_H_ |