blob: 19d4f5f98045d1fb64f81b94f40816ae84b9db6f [file] [log] [blame]
Nathan E. Egge20f9ae12017-03-02 20:13:17 -05001/*
Krishna Rapaka7319db52021-09-28 20:35:29 -07002 * Copyright (c) 2021, Alliance for Open Media. All rights reserved
Nathan E. Egge20f9ae12017-03-02 20:13:17 -05003 *
Vibhoothi41c6dd72021-10-12 18:48:26 +00004 * 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. Egge20f9ae12017-03-02 20:13:17 -050011 */
James Zerne1cbb132018-08-22 14:10:36 -070012#ifndef AOM_AV1_DECODER_INSPECTION_H_
13#define AOM_AV1_DECODER_INSPECTION_H_
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050014
Nathan E. Egge74b73382017-03-02 19:31:44 -050015#ifdef __cplusplus
16extern "C" {
17#endif // __cplusplus
18
Yaowu Xu6496fe92017-05-15 16:00:38 -070019#include "av1/common/seg_common.h"
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050020#if CONFIG_ACCOUNTING
Luc Trudeau83fbd572017-04-21 11:24:34 -040021#include "av1/decoder/accounting.h"
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050022#endif
23
Jim Bankoski8aced4b2018-10-01 13:03:41 -070024#ifndef AOM_AOM_AOMDX_H_
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050025typedef void (*aom_inspect_cb)(void *decoder, void *data);
Yushin Chof6741572017-10-24 20:07:46 -070026#endif
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050027
28typedef struct insp_mv insp_mv;
29
30struct insp_mv {
31 int16_t row;
32 int16_t col;
33};
34
35typedef struct insp_mi_data insp_mi_data;
36
37struct insp_mi_data {
38 insp_mv mv[2];
Yushin Choc24351c2017-10-24 14:59:08 -070039 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 Choc24351c2017-10-24 14:59:08 -070045 int16_t dual_filter_type;
46 int16_t filter[2];
Yushin Choc24351c2017-10-24 14:59:08 -070047 int16_t tx_type;
48 int16_t tx_size;
Yushin Choc24351c2017-10-24 14:59:08 -070049 int16_t cdef_level;
50 int16_t cdef_strength;
Yushin Choc24351c2017-10-24 14:59:08 -070051 int16_t cfl_alpha_idx;
52 int16_t cfl_alpha_sign;
Yushin Choc24351c2017-10-24 14:59:08 -070053 int16_t current_qindex;
Jim Bankoski21b68a02018-10-19 13:28:25 -070054 int16_t compound_type;
55 int16_t motion_mode;
Hui Su83684e12019-03-19 12:17:34 -070056 int16_t intrabc;
57 int16_t palette;
58 int16_t uv_palette;
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050059};
60
61typedef struct insp_frame_data insp_frame_data;
62
63struct insp_frame_data {
64#if CONFIG_ACCOUNTING
65 Accounting *accounting;
66#endif
67 insp_mi_data *mi_grid;
Jim Bankoski21b68a02018-10-19 13:28:25 -070068 int16_t frame_number;
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050069 int show_frame;
70 int frame_type;
71 int base_qindex;
72 int mi_rows;
73 int mi_cols;
Michael Bebenita2c2e5612017-04-06 22:19:04 -040074 int tile_mi_rows;
75 int tile_mi_cols;
Krishna Rapakad6b2b7d2022-03-15 17:09:39 -070076
Ryan Leiccc6ea72021-01-06 11:43:56 -080077 int32_t y_dequant[MAX_SEGMENTS][2];
78 int32_t u_dequant[MAX_SEGMENTS][2];
79 int32_t v_dequant[MAX_SEGMENTS][2];
Krishna Rapakad6b2b7d2022-03-15 17:09:39 -070080
Frederic Barbier1aeee2e2017-11-10 17:54:22 +010081 // TODO(negge): add per frame CDEF data
Yushin Choc24351c2017-10-24 14:59:08 -070082 int delta_q_present_flag;
83 int delta_q_res;
Jim Bankoski3f732872018-10-29 06:54:18 -070084 int show_existing_frame;
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050085};
86
87void ifd_init(insp_frame_data *fd, int frame_width, int frame_height);
88void ifd_clear(insp_frame_data *fd);
Jim Bankoskic04ce612018-12-20 15:45:33 -080089int ifd_inspect(insp_frame_data *fd, void *decoder, int skip_not_transform);
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050090
Nathan E. Egge74b73382017-03-02 19:31:44 -050091#ifdef __cplusplus
92} // extern "C"
93#endif // __cplusplus
James Zerne1cbb132018-08-22 14:10:36 -070094#endif // AOM_AV1_DECODER_INSPECTION_H_