1 /* 2 * Copyright 2015 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __JPEGE_SYNTAX_H__ 18 #define __JPEGE_SYNTAX_H__ 19 20 #include "mpp_frame.h" 21 #include "rk_venc_cmd.h" 22 23 typedef struct JpegeSyntax_t { 24 RK_U32 width; 25 RK_U32 height; 26 RK_U32 hor_stride; 27 RK_U32 ver_stride; 28 RK_U32 mcu_w; 29 RK_U32 mcu_h; 30 MppFrameFormat format; 31 MppFrameColorSpace color; 32 MppEncRotationCfg rotation; 33 RK_S32 mirroring; 34 RK_U32 offset_x; 35 RK_U32 offset_y; 36 37 /* For quantization table */ 38 RK_U32 quality; 39 RK_S32 q_factor; 40 RK_S32 qf_min; 41 RK_S32 qf_max; 42 RK_U8 *qtable_y; 43 RK_U8 *qtable_c; 44 45 /* 46 * For color conversion 47 * 48 * 0 = bt601 49 * 1 = bt709 50 * 2 = user defined 51 */ 52 RK_U32 color_conversion_type; 53 RK_U32 coeffA; 54 RK_U32 coeffB; 55 RK_U32 coeffC; 56 RK_U32 coeffE; 57 RK_U32 coeffF; 58 59 /* For slice encoding mode */ 60 RK_U32 slice_enable; 61 RK_U32 slice_size_mb_rows; 62 RK_U32 restart_interval; 63 64 /* 65 * For unit type and density 66 * 67 * units_type 0 - no unit 68 * 1 - dots per inch 69 * 2 - dots per cm 70 * 71 * X/Y density specify the pixel aspect ratio 72 */ 73 RK_U32 units_type; 74 RK_U32 density_x; 75 RK_U32 density_y; 76 77 /* For comment header */ 78 RK_U32 comment_length; 79 RK_U8 *comment_data; 80 81 /* For jpeg low delay slice encoding */ 82 RK_U32 low_delay; 83 RK_U32 part_rows; 84 RK_U32 restart_ri; 85 } JpegeSyntax; 86 87 typedef struct JpegeFeedback_t { 88 RK_U32 hw_status; /* zero -> correct; non-zero -> error */ 89 RK_U32 stream_length; 90 } JpegeFeedback; 91 92 #endif 93