1 /* 2 * 3 * Copyright (C) 2015 Amlogic, Inc. All rights reserved. 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 */ 16 17 enum NalUnitType 18 { 19 NAL_UNIT_CODED_SLICE_TRAIL_N = 0, // 0 20 NAL_UNIT_CODED_SLICE_TRAIL_R, // 1 21 22 NAL_UNIT_CODED_SLICE_TSA_N, // 2 23 NAL_UNIT_CODED_SLICE_TLA, // 3 // Current name in the spec: TSA_R 24 25 NAL_UNIT_CODED_SLICE_STSA_N, // 4 26 NAL_UNIT_CODED_SLICE_STSA_R, // 5 27 28 NAL_UNIT_CODED_SLICE_RADL_N, // 6 29 NAL_UNIT_CODED_SLICE_DLP, // 7 // Current name in the spec: RADL_R 30 31 NAL_UNIT_CODED_SLICE_RASL_N, // 8 32 NAL_UNIT_CODED_SLICE_TFD, // 9 // Current name in the spec: RASL_R 33 34 NAL_UNIT_RESERVED_10, 35 NAL_UNIT_RESERVED_11, 36 NAL_UNIT_RESERVED_12, 37 NAL_UNIT_RESERVED_13, 38 NAL_UNIT_RESERVED_14, 39 NAL_UNIT_RESERVED_15, 40 41 NAL_UNIT_CODED_SLICE_BLA, // 16 // Current name in the spec: BLA_W_LP 42 NAL_UNIT_CODED_SLICE_BLANT, // 17 // Current name in the spec: BLA_W_DLP 43 NAL_UNIT_CODED_SLICE_BLA_N_LP, // 18 44 NAL_UNIT_CODED_SLICE_IDR, // 19 // Current name in the spec: IDR_W_DLP 45 NAL_UNIT_CODED_SLICE_IDR_N_LP, // 20 46 NAL_UNIT_CODED_SLICE_CRA, // 21 47 NAL_UNIT_RESERVED_22, 48 NAL_UNIT_RESERVED_23, 49 50 NAL_UNIT_RESERVED_24, 51 NAL_UNIT_RESERVED_25, 52 NAL_UNIT_RESERVED_26, 53 NAL_UNIT_RESERVED_27, 54 NAL_UNIT_RESERVED_28, 55 NAL_UNIT_RESERVED_29, 56 NAL_UNIT_RESERVED_30, 57 NAL_UNIT_RESERVED_31, 58 59 NAL_UNIT_VPS, // 32 60 NAL_UNIT_SPS, // 33 61 NAL_UNIT_PPS, // 34 62 NAL_UNIT_ACCESS_UNIT_DELIMITER, // 35 63 NAL_UNIT_EOS, // 36 64 NAL_UNIT_EOB, // 37 65 NAL_UNIT_FILLER_DATA, // 38 66 NAL_UNIT_SEI, // 39 Prefix SEI 67 NAL_UNIT_SEI_SUFFIX, // 40 Suffix SEI 68 NAL_UNIT_RESERVED_41, 69 NAL_UNIT_RESERVED_42, 70 NAL_UNIT_RESERVED_43, 71 NAL_UNIT_RESERVED_44, 72 NAL_UNIT_RESERVED_45, 73 NAL_UNIT_RESERVED_46, 74 NAL_UNIT_RESERVED_47, 75 NAL_UNIT_UNSPECIFIED_48, 76 NAL_UNIT_UNSPECIFIED_49, 77 NAL_UNIT_UNSPECIFIED_50, 78 NAL_UNIT_UNSPECIFIED_51, 79 NAL_UNIT_UNSPECIFIED_52, 80 NAL_UNIT_UNSPECIFIED_53, 81 NAL_UNIT_UNSPECIFIED_54, 82 NAL_UNIT_UNSPECIFIED_55, 83 NAL_UNIT_UNSPECIFIED_56, 84 NAL_UNIT_UNSPECIFIED_57, 85 NAL_UNIT_UNSPECIFIED_58, 86 NAL_UNIT_UNSPECIFIED_59, 87 NAL_UNIT_UNSPECIFIED_60, 88 NAL_UNIT_UNSPECIFIED_61, 89 NAL_UNIT_UNSPECIFIED_62, 90 NAL_UNIT_UNSPECIFIED_63, 91 NAL_UNIT_INVALID, 92 }; 93 94 int forbidden_zero_bit; 95 int m_nalUnitType; 96 int m_reservedZero6Bits; 97 int m_temporalId; 98 99 //--------------------------------------------------- 100 // Amrisc Software Interrupt 101 //--------------------------------------------------- 102 #define AMRISC_STREAM_EMPTY_REQ 0x01 103 #define AMRISC_PARSER_REQ 0x02 104 #define AMRISC_MAIN_REQ 0x04 105 106 //--------------------------------------------------- 107 // AOM_AV1_DEC_STATUS (HEVC_DEC_STATUS) define 108 //--------------------------------------------------- 109 /*command*/ 110 #define AOM_AV1_DEC_IDLE 0 111 #define AOM_AV1_DEC_FRAME_HEADER 1 112 #define AOM_AV1_DEC_TILE_END 2 113 #define AOM_AV1_DEC_TG_END 3 114 #define AOM_AV1_DEC_LCU_END 4 115 #define AOM_AV1_DECODE_SLICE 5 116 #define AOM_AV1_SEARCH_HEAD 6 117 #define AOM_AV1_DUMP_LMEM 7 118 #define AOM_AV1_FGS_PARAM_CONT 8 119 #define AOM_AV1_FGS_PARAM_CONT 8 120 #define AOM_AV1_PIC_END_CONT 9 121 /*status*/ 122 #define AOM_AV1_DEC_PIC_END 0xe0 123 /*AOM_AV1_FGS_PARA: 124 Bit[11] - 0 Read, 1 - Write 125 Bit[10:8] - film_grain_params_ref_idx, For Write request 126 */ 127 #define AOM_AV1_FGS_PARAM 0xe1 128 #define AOM_AV1_DEC_PIC_END_PRE 0xe2 129 #define AOM_AV1_HEAD_PARSER_DONE 0xf0 130 #define AOM_AV1_HEAD_SEARCH_DONE 0xf1 131 #define AOM_AV1_SEQ_HEAD_PARSER_DONE 0xf2 132 #define AOM_AV1_FRAME_HEAD_PARSER_DONE 0xf3 133 #define AOM_AV1_FRAME_PARSER_DONE 0xf4 134 #define AOM_AV1_REDUNDANT_FRAME_HEAD_PARSER_DONE 0xf5 135 #define HEVC_ACTION_DONE 0xff 136 137 138 //--------------------------------------------------- 139 // Include "parser_cmd.h" 140 //--------------------------------------------------- 141 #define PARSER_CMD_SKIP_CFG_0 0x0000090b 142 143 #define PARSER_CMD_SKIP_CFG_1 0x1b14140f 144 145 #define PARSER_CMD_SKIP_CFG_2 0x001b1910 146 147 #define PARSER_CMD_NUMBER 37 148 149 unsigned short parser_cmd[PARSER_CMD_NUMBER] = { 150 0x0401, 151 0x8401, 152 0x0800, 153 0x0402, 154 0x9002, 155 0x1423, 156 0x8CC3, 157 0x1423, 158 0x8804, 159 0x9825, 160 0x0800, 161 0x04FE, 162 0x8406, 163 0x8411, 164 0x1800, 165 0x8408, 166 0x8409, 167 0x8C2A, 168 0x9C2B, 169 0x1C00, 170 0x840F, 171 0x8407, 172 0x8000, 173 0x8408, 174 0x2000, 175 0xA800, 176 0x8410, 177 0x04DE, 178 0x840C, 179 0x840D, 180 0xAC00, 181 0xA000, 182 0x08C0, 183 0x08E0, 184 0xA40E, 185 0xFC00, 186 0x7C00 187 }; 188