blob: 70b1c80fabdb4b2ea18b12a4a86a49eae074b81c [file] [log] [blame]
Nathan E. Egge20f9ae12017-03-02 20:13:17 -05001/*
2 * Copyright (c) 2017, 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 */
James Zerne1cbb132018-08-22 14:10:36 -070011#ifndef AOM_AV1_DECODER_INSPECTION_H_
12#define AOM_AV1_DECODER_INSPECTION_H_
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050013
Nathan E. Egge74b73382017-03-02 19:31:44 -050014#ifdef __cplusplus
15extern "C" {
16#endif // __cplusplus
17
Yaowu Xu6496fe92017-05-15 16:00:38 -070018#include "av1/common/seg_common.h"
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050019#if CONFIG_ACCOUNTING
Luc Trudeau83fbd572017-04-21 11:24:34 -040020#include "av1/decoder/accounting.h"
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050021#endif
22
Jim Bankoski8aced4b2018-10-01 13:03:41 -070023#ifndef AOM_AOM_AOMDX_H_
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050024typedef void (*aom_inspect_cb)(void *decoder, void *data);
Yushin Chof6741572017-10-24 20:07:46 -070025#endif
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050026
27typedef struct insp_mv insp_mv;
28
29struct insp_mv {
30 int16_t row;
31 int16_t col;
32};
33
34typedef struct insp_mi_data insp_mi_data;
35
36struct insp_mi_data {
37 insp_mv mv[2];
Yushin Choc24351c2017-10-24 14:59:08 -070038 int16_t ref_frame[2];
39 int16_t mode;
40 int16_t uv_mode;
chiyotsai0f5cd052020-08-27 14:37:44 -070041 int16_t bsize;
Yushin Choc24351c2017-10-24 14:59:08 -070042 int16_t skip;
43 int16_t segment_id;
Yushin Choc24351c2017-10-24 14:59:08 -070044 int16_t dual_filter_type;
45 int16_t filter[2];
Yushin Choc24351c2017-10-24 14:59:08 -070046 int16_t tx_type;
47 int16_t tx_size;
Yushin Choc24351c2017-10-24 14:59:08 -070048 int16_t cdef_level;
49 int16_t cdef_strength;
Yushin Choc24351c2017-10-24 14:59:08 -070050 int16_t cfl_alpha_idx;
51 int16_t cfl_alpha_sign;
Yushin Choc24351c2017-10-24 14:59:08 -070052 int16_t current_qindex;
Jim Bankoski21b68a02018-10-19 13:28:25 -070053 int16_t compound_type;
54 int16_t motion_mode;
Hui Su83684e12019-03-19 12:17:34 -070055 int16_t intrabc;
56 int16_t palette;
57 int16_t uv_palette;
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050058};
59
60typedef struct insp_frame_data insp_frame_data;
61
62struct insp_frame_data {
63#if CONFIG_ACCOUNTING
64 Accounting *accounting;
65#endif
66 insp_mi_data *mi_grid;
Jim Bankoski21b68a02018-10-19 13:28:25 -070067 int16_t frame_number;
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050068 int show_frame;
69 int frame_type;
70 int base_qindex;
71 int mi_rows;
72 int mi_cols;
Michael Bebenita2c2e5612017-04-06 22:19:04 -040073 int tile_mi_rows;
74 int tile_mi_cols;
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050075 int16_t y_dequant[MAX_SEGMENTS][2];
Yaowu Xube42dc72017-11-08 17:38:24 -080076 int16_t u_dequant[MAX_SEGMENTS][2];
77 int16_t v_dequant[MAX_SEGMENTS][2];
Frederic Barbier1aeee2e2017-11-10 17:54:22 +010078 // TODO(negge): add per frame CDEF data
Yushin Choc24351c2017-10-24 14:59:08 -070079 int delta_q_present_flag;
80 int delta_q_res;
Jim Bankoski3f732872018-10-29 06:54:18 -070081 int show_existing_frame;
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050082};
83
84void ifd_init(insp_frame_data *fd, int frame_width, int frame_height);
85void ifd_clear(insp_frame_data *fd);
Jim Bankoskic04ce612018-12-20 15:45:33 -080086int ifd_inspect(insp_frame_data *fd, void *decoder, int skip_not_transform);
Nathan E. Egge2cf03b12017-02-22 16:19:59 -050087
Nathan E. Egge74b73382017-03-02 19:31:44 -050088#ifdef __cplusplus
89} // extern "C"
90#endif // __cplusplus
James Zerne1cbb132018-08-22 14:10:36 -070091#endif // AOM_AV1_DECODER_INSPECTION_H_