diff options
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2015-08-05 15:47:51 +0530 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2015-10-12 21:18:07 +0000 |
commit | 903fd2be3063609dd3cd7ad0691de46c1b52b7d1 (patch) | |
tree | 5f08406bbf76d0a66c0c5e609ef91d068c283f0a | |
parent | b34913857dacd4b7f82715c48ae1de9c56ede9e0 (diff) | |
download | android_external_libmpeg2-903fd2be3063609dd3cd7ad0691de46c1b52b7d1.tar.gz android_external_libmpeg2-903fd2be3063609dd3cd7ad0691de46c1b52b7d1.tar.bz2 android_external_libmpeg2-903fd2be3063609dd3cd7ad0691de46c1b52b7d1.zip |
Fixed few stride issues
Removed alignment requirements for stride
Fixed strides passed to frame copy function
Display width is passed to frame copy function instead of stride
Moved decoder specific definitions from common to decoder files
Bug: 20932810
Change-Id: Ieb1370e2ff9c6b3d04e4c0b9630653943346eb54
-rw-r--r-- | common/impeg2_defs.h | 21 | ||||
-rw-r--r-- | decoder/impeg2d_api_main.c | 11 | ||||
-rw-r--r-- | decoder/impeg2d_dec_hdr.c | 2 | ||||
-rw-r--r-- | decoder/impeg2d_pic_proc.c | 10 | ||||
-rw-r--r-- | decoder/impeg2d_structs.h | 21 |
5 files changed, 28 insertions, 37 deletions
diff --git a/common/impeg2_defs.h b/common/impeg2_defs.h index f1523f2..f575fe5 100644 --- a/common/impeg2_defs.h +++ b/common/impeg2_defs.h @@ -23,27 +23,6 @@ #include <assert.h> -/* Decoder needs at least 4 reference buffers in order to support format conversion in a thread and -to support B pictures. Because of format conversion in a thread, codec delay is now 2 frames instead of 1. -To reduce this delay, format conversion has to wait for MB status before converting for B pictures. -To avoid this check the delay is increased to 2 and hence number of reference frames minimum is 4 */ -#define NUM_INT_FRAME_BUFFERS 4 - - -#define MAX_WIDTH 4096 -#define MAX_HEIGHT 2160 - -#define MIN_WIDTH 16 -#define MIN_HEIGHT 16 - - -#define MAX_FRM_SIZE (MAX_WIDTH * MAX_HEIGHT * 2) /* Supports only 420P and 422ILE */ - -#define DEC_ORDER 0 - -#define MAX_BITSTREAM_BUFFER_SIZE 2000 * 1024 - - /****************************************************************************** * MPEG2 Start code and other code definitions *******************************************************************************/ diff --git a/decoder/impeg2d_api_main.c b/decoder/impeg2d_api_main.c index a96afd5..70baae8 100644 --- a/decoder/impeg2d_api_main.c +++ b/decoder/impeg2d_api_main.c @@ -992,15 +992,6 @@ IV_API_CALL_STATUS_T impeg2d_api_set_params(iv_obj_t *ps_dechdl,void *pv_api_ip, } } - else - { - if(((WORD32)ps_ctl_dec_ip->s_ivd_ctl_set_config_ip_t.u4_disp_wd < 0) || - ((ps_ctl_dec_ip->s_ivd_ctl_set_config_ip_t.u4_disp_wd != 0) && (ps_ctl_dec_ip->s_ivd_ctl_set_config_ip_t.u4_disp_wd < ps_dec_state->u2_horizontal_size))) - { - ps_ctl_dec_op->s_ivd_ctl_set_config_op_t.u4_error_code = IV_FAIL; - return(IV_FAIL); - } - } ps_dec_state->u2_decode_header = (UWORD8)ps_ctl_dec_ip->s_ivd_ctl_set_config_ip_t.e_vid_dec_mode; @@ -3156,7 +3147,7 @@ IV_API_CALL_STATUS_T impeg2d_api_entity(iv_obj_t *ps_dechdl, if (0 == ps_dec_state->u4_frm_buf_stride) { - ps_dec_state->u4_frm_buf_stride = ALIGN16(ps_dec_state->u2_horizontal_size); + ps_dec_state->u4_frm_buf_stride = (ps_dec_state->u2_horizontal_size); } ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_y_wd = ps_dec_state->u2_horizontal_size; diff --git a/decoder/impeg2d_dec_hdr.c b/decoder/impeg2d_dec_hdr.c index 061bf04..d9c87b6 100644 --- a/decoder/impeg2d_dec_hdr.c +++ b/decoder/impeg2d_dec_hdr.c @@ -156,7 +156,7 @@ IMPEG2D_ERROR_CODES_T impeg2d_dec_seq_hdr(dec_state_t *ps_dec) ps_dec->u2_vertical_size = u2_height; if (0 == ps_dec->u4_frm_buf_stride) { - ps_dec->u4_frm_buf_stride = (UWORD32) ALIGN16(u2_width); + ps_dec->u4_frm_buf_stride = (UWORD32) (u2_width); } } else diff --git a/decoder/impeg2d_pic_proc.c b/decoder/impeg2d_pic_proc.c index e79e87a..0aee534 100644 --- a/decoder/impeg2d_pic_proc.c +++ b/decoder/impeg2d_pic_proc.c @@ -70,14 +70,14 @@ void impeg2d_format_convert(dec_state_t *ps_dec, { ps_dec->pf_copy_yuv420p_buf(pu1_src_y, pu1_src_u, pu1_src_v, pu1_dst_y, pu1_dst_u, pu1_dst_v, - ps_dec->u2_frame_width, + ps_dec->u2_horizontal_size, u4_num_rows, - ps_dec->u4_frm_buf_stride, - (ps_dec->u4_frm_buf_stride >> 1), - (ps_dec->u4_frm_buf_stride >> 1), ps_dec->u2_frame_width, (ps_dec->u2_frame_width >> 1), - (ps_dec->u2_frame_width >> 1)); + (ps_dec->u2_frame_width >> 1), + ps_dec->u4_frm_buf_stride, + (ps_dec->u4_frm_buf_stride >> 1), + (ps_dec->u4_frm_buf_stride >> 1)); } else if (IV_YUV_422ILE == ps_dec->i4_chromaFormat) { diff --git a/decoder/impeg2d_structs.h b/decoder/impeg2d_structs.h index 63a0b03..9fa2631 100644 --- a/decoder/impeg2d_structs.h +++ b/decoder/impeg2d_structs.h @@ -20,6 +20,27 @@ #ifndef __IMPEG2D_STRUCTS_H__ #define __IMPEG2D_STRUCTS_H__ +/* Decoder needs at least 4 reference buffers in order to support format conversion in a thread and +to support B pictures. Because of format conversion in a thread, codec delay is now 2 frames instead of 1. +To reduce this delay, format conversion has to wait for MB status before converting for B pictures. +To avoid this check the delay is increased to 2 and hence number of reference frames minimum is 4. +Because of temporal dependency in deinterlacer one additional buffer is also needed */ +#define NUM_INT_FRAME_BUFFERS 4 + + +#define MAX_WIDTH 4096 +#define MAX_HEIGHT 2160 + +#define MIN_WIDTH 16 +#define MIN_HEIGHT 16 + + +#define MAX_FRM_SIZE (MAX_WIDTH * MAX_HEIGHT * 2) /* Supports only 420P and 422ILE */ + +#define DEC_ORDER 0 + +#define MAX_BITSTREAM_BUFFER_SIZE 2000 * 1024 + typedef enum { CMD_PROCESS, |