• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Description:
19 */
20 #ifndef AVS_H_
21 #define AVS_H_
22 
23 #ifdef CONFIG_AMLOGIC_AVSP_LONG_CABAC
24 #define AVSP_LONG_CABAC
25 #endif
26 /*#define BITSTREAM_READ_TMP_NO_CACHE*/
27 
28 #ifdef AVSP_LONG_CABAC
29 #define MAX_CODED_FRAME_SIZE 1500000         /*!< bytes for one frame*/
30 #define LOCAL_HEAP_SIZE    (1024*1024*10)
31 /*
32  *#define MAX_CODED_FRAME_SIZE  240000
33  *#define MAX_CODED_FRAME_SIZE  700000
34  */
35 #define SVA_STREAM_BUF_SIZE 1024
36 
37 extern void *es_write_addr_virt;
38 extern dma_addr_t es_write_addr_phy;
39 
40 extern void *bitstream_read_tmp;
41 extern dma_addr_t bitstream_read_tmp_phy;
42 extern void *avsp_heap_adr;
43 
44 int avs_get_debug_flag(void);
45 
46 int process_long_cabac(void);
47 
48 /* bit [6] - skip_mode_flag
49  * bit [5:4] - picture_type
50  * bit [3] - picture_structure (0-Field, 1-Frame)
51  * bit [2] - fixed_picture_qp
52  * bit [1] - progressive_sequence
53  * bit [0] - active
54  */
55 #define LONG_CABAC_REQ        AV_SCRATCH_K
56 #define LONG_CABAC_SRC_ADDR   AV_SCRATCH_H
57 #define LONG_CABAC_DES_ADDR   AV_SCRATCH_I
58 /* bit[31:16] - vertical_size
59  * bit[15:0] - horizontal_size
60  */
61 #define LONG_CABAC_PIC_SIZE   AV_SCRATCH_J
62 
63 #endif
64 
65 /*
66  *#define PERFORMANCE_DEBUG
67  *#define DUMP_DEBUG
68  */
69 #define AVS_DEBUG_PRINT         0x01
70 #define AVS_DEBUG_UCODE         0x02
71 #define AVS_DEBUG_OLD_ERROR_HANDLE	0x10
72 #define AVS_DEBUG_USE_FULL_SPEED 0x80
73 #define AEC_DUMP				0x100
74 #define STREAM_INFO_DUMP		0x200
75 #define SLICE_INFO_DUMP			0x400
76 #define MB_INFO_DUMP			0x800
77 #define MB_NUM_DUMP				0x1000
78 #define BLOCK_NUM_DUMP			0x2000
79 #define COEFF_DUMP				0x4000
80 #define ES_DUMP					0x8000
81 #define DQUANT_DUMP				0x10000
82 #define STREAM_INFO_DUMP_MORE   0x20000
83 #define STREAM_INFO_DUMP_MORE2  0x40000
84 
85 extern void *es_write_addr_virt;
86 extern void *bitstream_read_tmp;
87 extern dma_addr_t bitstream_read_tmp_phy;
88 int read_bitstream(unsigned char *Buf, int size);
89 int u_v(int LenInBits, char *tracestring);
90 
91 #endif
92