summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--drivers/amvdec_ports/Makefile13
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.c22
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.h3
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.c534
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.h39
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_drv.c57
-rw-r--r--drivers/amvdec_ports/aml_vcodec_drv.h11
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.c18
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.h8
-rw-r--r--drivers/amvdec_ports/aml_vcodec_vfm.c9
-rw-r--r--drivers/amvdec_ports/aml_vcodec_vfm.h6
-rw-r--r--drivers/amvdec_ports/decoder/aml_h264_parser.c662
-rw-r--r--[-rwxr-xr-x]drivers/amvdec_ports/decoder/aml_h264_parser.h226
-rw-r--r--drivers/amvdec_ports/decoder/aml_hevc_parser.c1274
-rw-r--r--[-rwxr-xr-x]drivers/amvdec_ports/decoder/aml_hevc_parser.h137
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.c397
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.h163
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg12_parser.c198
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg12_parser.h74
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.c1233
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.h250
-rw-r--r--drivers/amvdec_ports/decoder/aml_vp9_parser.c299
-rw-r--r--[-rwxr-xr-x]drivers/amvdec_ports/decoder/aml_vp9_parser.h279
-rw-r--r--drivers/amvdec_ports/decoder/h264_parse.c389
-rw-r--r--drivers/amvdec_ports/decoder/h264_parse.h141
-rw-r--r--drivers/amvdec_ports/decoder/h264_stream.c111
-rw-r--r--drivers/amvdec_ports/decoder/h264_stream.h39
-rw-r--r--drivers/amvdec_ports/decoder/vdec_h264_if.c357
-rw-r--r--drivers/amvdec_ports/decoder/vdec_hevc_if.c477
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mjpeg_if.c498
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg12_if.c490
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg4_if.c499
-rw-r--r--drivers/amvdec_ports/decoder/vdec_vp9_if.c461
-rw-r--r--[-rwxr-xr-x]drivers/amvdec_ports/decoder/vdec_vp9_trigger.h0
-rw-r--r--drivers/amvdec_ports/test/vcodec_m2m_test.c18
-rw-r--r--drivers/amvdec_ports/utils/common.c221
-rw-r--r--drivers/amvdec_ports/utils/common.h72
-rw-r--r--drivers/amvdec_ports/utils/get_bits.h590
-rw-r--r--drivers/amvdec_ports/utils/golomb.c147
-rw-r--r--drivers/amvdec_ports/utils/golomb.h500
-rw-r--r--drivers/amvdec_ports/utils/pixfmt.h470
-rw-r--r--drivers/amvdec_ports/utils/put_bits.h323
-rw-r--r--drivers/amvdec_ports/vdec_drv_base.h11
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.c45
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.h10
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c219
-rw-r--r--drivers/frame_provider/decoder/h265/vh265.c308
-rw-r--r--drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c334
-rw-r--r--drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c233
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c317
-rw-r--r--drivers/frame_provider/decoder/utils/Makefile1
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.c19
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.c131
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.h22
-rw-r--r--drivers/frame_provider/decoder/vp9/vvp9.c388
55 files changed, 11471 insertions, 2282 deletions
diff --git a/drivers/amvdec_ports/decoder/aml_hevc_parser.h b/drivers/amvdec_ports/decoder/aml_hevc_parser.h
index be21f14..267450f 100755..100644
--- a/drivers/amvdec_ports/decoder/aml_hevc_parser.h
+++ b/drivers/amvdec_ports/decoder/aml_hevc_parser.h
@@ -19,41 +19,48 @@
#ifndef AML_HEVC_PARSER_H
#define AML_HEVC_PARSER_H
-#define MAX_DPB_SIZE 16 // A.4.1
-#define MAX_REFS 16
+#include "../utils/common.h"
-#define MAX_NB_THREADS 16
-#define SHIFT_CTB_WPP 2
+#define MAX_DPB_SIZE 16 // A.4.1
+#define MAX_REFS 16
+
+#define MAX_NB_THREADS 16
+#define SHIFT_CTB_WPP 2
/**
* 7.4.2.1
*/
-#define MAX_SUB_LAYERS 7
-#define MAX_VPS_COUNT 16
-#define MAX_SPS_COUNT 32
-#define MAX_PPS_COUNT 256
-#define MAX_SHORT_TERM_RPS_COUNT 64
-#define MAX_CU_SIZE 128
+#define MAX_SUB_LAYERS 7
+#define MAX_VPS_COUNT 16
+#define MAX_SPS_COUNT 32
+#define MAX_PPS_COUNT 256
+#define MAX_SHORT_TERM_RPS_COUNT 64
+#define MAX_CU_SIZE 128
//TODO: check if this is really the maximum
-#define MAX_TRANSFORM_DEPTH 5
+#define MAX_TRANSFORM_DEPTH 5
+
+#define MAX_TB_SIZE 32
+#define MAX_PB_SIZE 64
+#define MAX_LOG2_CTB_SIZE 6
+#define MAX_QP 51
+#define DEFAULT_INTRA_TC_OFFSET 2
-#define MAX_TB_SIZE 32
-#define MAX_PB_SIZE 64
-#define MAX_LOG2_CTB_SIZE 6
-#define MAX_QP 51
-#define DEFAULT_INTRA_TC_OFFSET 2
+#define HEVC_CONTEXTS 183
-#define HEVC_CONTEXTS 183
+#define MRG_MAX_NUM_CANDS 5
-#define MRG_MAX_NUM_CANDS 5
+#define L0 0
+#define L1 1
-#define L0 0
-#define L1 1
+#define EPEL_EXTRA_BEFORE 1
+#define EPEL_EXTRA_AFTER 2
+#define EPEL_EXTRA 3
-#define EPEL_EXTRA_BEFORE 1
-#define EPEL_EXTRA_AFTER 2
-#define EPEL_EXTRA 3
+#define FF_PROFILE_HEVC_MAIN 1
+#define FF_PROFILE_HEVC_MAIN_10 2
+#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
+#define FF_PROFILE_HEVC_REXT 4
/**
* Value of the luma sample at position (x, y) in the 2D array tab.
@@ -273,11 +280,6 @@ struct HEVCWindow {
u32 bottom_offset;
};
-struct AVRational{
- int num; ///< numerator
- int den; ///< denominator
-};
-
struct VUI {
struct AVRational sar;
@@ -322,35 +324,26 @@ struct VUI {
};
struct PTLCommon {
- u8 profile_space;
- u8 tier_flag;
- u8 profile_idc;
- u8 profile_compatibility_flag[32];
- u8 level_idc;
- u8 progressive_source_flag;
- u8 interlaced_source_flag;
- u8 non_packed_constraint_flag;
- u8 frame_only_constraint_flag;
+ u8 profile_space;
+ u8 tier_flag;
+ u8 profile_idc;
+ u8 profile_compatibility_flag[32];
+ u8 level_idc;
+ u8 progressive_source_flag;
+ u8 interlaced_source_flag;
+ u8 non_packed_constraint_flag;
+ u8 frame_only_constraint_flag;
};
struct PTL {
- int general_profile_space;
- u8 general_tier_flag;
- int general_profile_idc;
- int general_profile_compatibility_flag[32];
- int general_level_idc;
-
- u8 sub_layer_profile_present_flag[MAX_SUB_LAYERS];
- u8 sub_layer_level_present_flag[MAX_SUB_LAYERS];
-
- int sub_layer_profile_space[MAX_SUB_LAYERS];
- u8 sub_layer_tier_flag[MAX_SUB_LAYERS];
- int sub_layer_profile_idc[MAX_SUB_LAYERS];
- u8 sub_layer_profile_compatibility_flags[MAX_SUB_LAYERS][32];
- int sub_layer_level_idc[MAX_SUB_LAYERS];
+ struct PTLCommon general_ptl;
+ struct PTLCommon sub_layer_ptl[HEVC_MAX_SUB_LAYERS];
+
+ u8 sub_layer_profile_present_flag[HEVC_MAX_SUB_LAYERS];
+ u8 sub_layer_level_present_flag[HEVC_MAX_SUB_LAYERS];
};
-struct HEVCVPS {
+struct h265_VPS_t {
u8 vps_temporal_id_nesting_flag;
int vps_max_layers;
int vps_max_sub_layers; ///< vps_max_temporal_layers_minus1 + 1
@@ -368,9 +361,6 @@ struct HEVCVPS {
u8 vps_poc_proportional_to_timing_flag;
int vps_num_ticks_poc_diff_one; ///< vps_num_ticks_poc_diff_one_minus1 + 1
int vps_num_hrd_parameters;
-
- u8 data[4096];
- int data_size;
};
struct ScalingList {
@@ -380,8 +370,9 @@ struct ScalingList {
u8 sl_dc[2][6];
};
-struct HEVCSPS {
+struct h265_SPS_t {
u8 vps_id;
+ u8 sps_id;
int chroma_format_idc;
u8 separate_colour_plane_flag;
@@ -398,9 +389,9 @@ struct HEVCSPS {
int max_sub_layers;
struct {
- int max_dec_pic_buffering;
- int num_reorder_pics;
- int max_latency_increase;
+ int max_dec_pic_buffering;
+ int num_reorder_pics;
+ int max_latency_increase;
} temporal_layer[HEVC_MAX_SUB_LAYERS];
u8 temporal_id_nesting_flag;
@@ -422,11 +413,11 @@ struct HEVCSPS {
u8 num_long_term_ref_pics_sps;
struct {
- u8 bit_depth;
- u8 bit_depth_chroma;
- u32 log2_min_pcm_cb_size;
- u32 log2_max_pcm_cb_size;
- u8 loop_filter_disable_flag;
+ u8 bit_depth;
+ u8 bit_depth_chroma;
+ u32 log2_min_pcm_cb_size;
+ u32 log2_max_pcm_cb_size;
+ u8 loop_filter_disable_flag;
} pcm;
u8 sps_temporal_mvp_enabled_flag;
u8 sps_strong_intra_smoothing_enable_flag;
@@ -441,13 +432,16 @@ struct HEVCSPS {
int max_transform_hierarchy_depth_inter;
int max_transform_hierarchy_depth_intra;
+ int sps_range_extension_flag;
int transform_skip_rotation_enabled_flag;
int transform_skip_context_enabled_flag;
int implicit_rdpcm_enabled_flag;
int explicit_rdpcm_enabled_flag;
+ int extended_precision_processing_flag;
int intra_smoothing_disabled_flag;
int high_precision_offsets_enabled_flag;
int persistent_rice_adaptation_enabled_flag;
+ int cabac_bypass_alignment_enabled_flag;
///< coded frame dimension in various units
int width;
@@ -472,7 +466,7 @@ struct HEVCSPS {
int data_size;
};
-struct HEVCPPS {
+struct h265_PPS_t {
u32 sps_id; ///< seq_parameter_set_id
u8 sign_data_hiding_flag;
@@ -544,20 +538,19 @@ struct HEVCPPS {
int *tile_pos_rs; ///< TilePosRS
int *min_tb_addr_zs; ///< MinTbAddrZS
int *min_tb_addr_zs_tab;///< MinTbAddrZS
-
- u8 data[4096];
- int data_size;
};
-struct HEVCParamSets {
+struct h265_param_sets {
bool vps_parsed;
bool sps_parsed;
bool pps_parsed;
/* currently active parameter sets */
- struct HEVCVPS vps;
- struct HEVCSPS sps;
- struct HEVCPPS pps;
+ struct h265_VPS_t vps;
+ struct h265_SPS_t sps;
+ struct h265_PPS_t pps;
};
+int h265_decode_extradata_ps(u8 *data, int size, struct h265_param_sets *ps);
+
#endif /* AML_HEVC_PARSER_H */