mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
amvdec: optimize vdec_info and vframe_counter_s [2/2]
PD#SWPL-160457 Problem: memcpy beyond individual struct members Solution: create a named mirror of an anonymous struct union Verify: sc2&sm1 Change-Id: If86c3581ac473bb8e4c2b2021bedcbe44ad406e2 Signed-off-by: Hao Shi <hao.shi@amlogic.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#define __AMVDEC_IOC_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/stddef.h>
|
||||
|
||||
#define _A_M_V 'S'
|
||||
|
||||
@@ -302,9 +303,18 @@ struct av_param_qosinfo_t {
|
||||
struct vframe_qos_s vframe_qos[QOS_FRAME_NUM];
|
||||
};
|
||||
|
||||
#ifndef struct_group
|
||||
#define struct_group(NAME, MEMBERS...) \
|
||||
union { \
|
||||
struct { MEMBERS }; \
|
||||
struct { MEMBERS } NAME; \
|
||||
}
|
||||
#endif
|
||||
|
||||
struct vdec_info {
|
||||
char vdec_name[16];
|
||||
__u32 ver;
|
||||
struct_group(normal_info,
|
||||
__u32 frame_width;
|
||||
__u32 frame_height;
|
||||
__u32 frame_rate;
|
||||
@@ -332,7 +342,9 @@ struct vdec_info {
|
||||
};
|
||||
__u32 offset;
|
||||
__u32 ratio_control;
|
||||
);
|
||||
char reserved[0];
|
||||
struct_group(ipb,
|
||||
unsigned int i_decoded_frames;/*i frames decoded*/
|
||||
unsigned int i_lost_frames;/*i frames can not be decoded*/
|
||||
unsigned int i_concealed_frames;/*i frames decoded but have some error*/
|
||||
@@ -342,6 +354,7 @@ struct vdec_info {
|
||||
unsigned int b_decoded_frames;
|
||||
unsigned int b_lost_frames;
|
||||
unsigned int b_concealed_frames;
|
||||
);
|
||||
char endipb_line[0];
|
||||
};
|
||||
|
||||
@@ -454,6 +467,7 @@ struct vframe_comm_s {
|
||||
struct vframe_counter_s {
|
||||
struct vframe_qos_s qos;
|
||||
__u32 decode_time_cost;/*us*/
|
||||
struct_group(normal_info,
|
||||
__u32 frame_width;
|
||||
__u32 frame_height;
|
||||
__u32 frame_rate;
|
||||
@@ -481,11 +495,15 @@ struct vframe_counter_s {
|
||||
};
|
||||
__u32 offset;
|
||||
__u32 ratio_control;
|
||||
|
||||
);
|
||||
|
||||
__u32 vf_type;
|
||||
__u32 signal_type;
|
||||
__u32 pts;
|
||||
__u64 pts_us64;
|
||||
/*mediacodec report*/
|
||||
struct_group(ipb,
|
||||
unsigned int i_decoded_frames; //i frames decoded
|
||||
unsigned int i_lost_frames;//i frames can not be decoded
|
||||
unsigned int i_concealed_frames;//i frames decoded but have some error
|
||||
@@ -496,6 +514,9 @@ struct vframe_counter_s {
|
||||
unsigned int b_lost_frames;
|
||||
unsigned int b_concealed_frames;
|
||||
unsigned int av_resynch_counter;
|
||||
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
struct vframe_counter_s_old {
|
||||
|
||||
Reference in New Issue
Block a user