Merge Android R
Bug: 168057903 Merged-In: I609894770235673dc005d118062b9f8b4af08ba8 Change-Id: I952771c07e35e8bd48412afa45df09228854dc29
This commit is contained in:
commit
5ff5c2c336
8 changed files with 68 additions and 38 deletions
2
PREUPLOAD.cfg
Normal file
2
PREUPLOAD.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[Hook Scripts]
|
||||
mainline_hook = ${REPO_ROOT}/frameworks/av/tools/mainline_hook_project.sh
|
||||
|
|
@ -610,6 +610,16 @@ typedef enum
|
|||
*/
|
||||
#define MAX_H264_QP 51
|
||||
|
||||
/**
|
||||
* @brief Minimum delta scale supported in H264 spec
|
||||
*/
|
||||
#define MIN_H264_DELTA_SCALE (-128)
|
||||
|
||||
/**
|
||||
* @brief Maximum delta scale supported in H264 spec
|
||||
*/
|
||||
#define MAX_H264_DELTA_SCALE 127
|
||||
|
||||
/**
|
||||
* @breif Total number of transform sizes
|
||||
* used for sizeID while getting scale matrix
|
||||
|
|
|
|||
|
|
@ -427,9 +427,10 @@ WORD32 ih264d_parse_pps(dec_struct_t * ps_dec, dec_bit_stream_t * ps_bitstrm)
|
|||
|
||||
if(ps_pps->u1_pic_scaling_list_present_flag[i4_i])
|
||||
{
|
||||
WORD32 ret;
|
||||
if(i4_i < 6)
|
||||
{
|
||||
ih264d_scaling_list(
|
||||
ret = ih264d_scaling_list(
|
||||
ps_pps->i2_pic_scalinglist4x4[i4_i],
|
||||
16,
|
||||
&ps_pps->u1_pic_use_default_scaling_matrix_flag[i4_i],
|
||||
|
|
@ -437,12 +438,17 @@ WORD32 ih264d_parse_pps(dec_struct_t * ps_dec, dec_bit_stream_t * ps_bitstrm)
|
|||
}
|
||||
else
|
||||
{
|
||||
ih264d_scaling_list(
|
||||
ret = ih264d_scaling_list(
|
||||
ps_pps->i2_pic_scalinglist8x8[i4_i - 6],
|
||||
64,
|
||||
&ps_pps->u1_pic_use_default_scaling_matrix_flag[i4_i],
|
||||
ps_bitstrm);
|
||||
}
|
||||
|
||||
if(ret != OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -742,7 +748,7 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
|
|||
{
|
||||
if(i4_i < 6)
|
||||
{
|
||||
ih264d_scaling_list(
|
||||
ret = ih264d_scaling_list(
|
||||
ps_seq->i2_scalinglist4x4[i4_i],
|
||||
16,
|
||||
&ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
|
||||
|
|
@ -750,12 +756,16 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
|
|||
}
|
||||
else
|
||||
{
|
||||
ih264d_scaling_list(
|
||||
ret = ih264d_scaling_list(
|
||||
ps_seq->i2_scalinglist8x8[i4_i - 6],
|
||||
64,
|
||||
&ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
|
||||
ps_bitstrm);
|
||||
}
|
||||
if(ret != OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1387,17 +1387,17 @@ void ih264d_init_ref_idx_lx_b(dec_struct_t *ps_dec)
|
|||
/* reference list to handle of errors */
|
||||
{
|
||||
UWORD8 u1_i;
|
||||
pic_buffer_t *ps_ref_pic;
|
||||
pic_buffer_t ref_pic;
|
||||
|
||||
ps_ref_pic = ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS;
|
||||
ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS);
|
||||
|
||||
if(NULL == ps_ref_pic->pu1_buf1)
|
||||
if(NULL == ref_pic.pu1_buf1)
|
||||
{
|
||||
ps_ref_pic = ps_dec->ps_cur_pic;
|
||||
ref_pic = *ps_dec->ps_cur_pic;
|
||||
}
|
||||
for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
|
||||
{
|
||||
*ps_ref_pic_buf_lx = *ps_ref_pic;
|
||||
*ps_ref_pic_buf_lx = ref_pic;
|
||||
ps_ref_pic_buf_lx++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1414,17 +1414,17 @@ void ih264d_init_ref_idx_lx_b(dec_struct_t *ps_dec)
|
|||
/* reference list to handle of errors */
|
||||
{
|
||||
UWORD8 u1_i;
|
||||
pic_buffer_t *ps_ref_pic;
|
||||
pic_buffer_t ref_pic;
|
||||
|
||||
ps_ref_pic = ps_dpb_mgr->ps_init_dpb[0][0];
|
||||
ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0]);
|
||||
|
||||
if(NULL == ps_ref_pic->pu1_buf1)
|
||||
if(NULL == ref_pic.pu1_buf1)
|
||||
{
|
||||
ps_ref_pic = ps_dec->ps_cur_pic;
|
||||
ref_pic = *ps_dec->ps_cur_pic;
|
||||
}
|
||||
for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
|
||||
{
|
||||
*ps_ref_pic_buf_lx = *ps_ref_pic;
|
||||
*ps_ref_pic_buf_lx = ref_pic;
|
||||
ps_ref_pic_buf_lx++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1498,17 +1498,17 @@ void ih264d_init_ref_idx_lx_b(dec_struct_t *ps_dec)
|
|||
/* reference list to handle of errors */
|
||||
{
|
||||
UWORD8 u1_i;
|
||||
pic_buffer_t *ps_ref_pic;
|
||||
pic_buffer_t ref_pic;
|
||||
|
||||
ps_ref_pic = ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS;
|
||||
ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS);
|
||||
|
||||
if(NULL == ps_ref_pic->pu1_buf1)
|
||||
if(NULL == ref_pic.pu1_buf1)
|
||||
{
|
||||
ps_ref_pic = ps_dec->ps_cur_pic;
|
||||
ref_pic = *ps_dec->ps_cur_pic;
|
||||
}
|
||||
for(u1_i = u1_L1; u1_i < u1_max_ref_idx_l1; u1_i++)
|
||||
{
|
||||
*ps_ref_pic_buf_lx = *ps_ref_pic;
|
||||
*ps_ref_pic_buf_lx = ref_pic;
|
||||
ps_ref_pic_buf_lx++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1525,17 +1525,17 @@ void ih264d_init_ref_idx_lx_b(dec_struct_t *ps_dec)
|
|||
/* reference list to handle of errors */
|
||||
{
|
||||
UWORD8 u1_i;
|
||||
pic_buffer_t *ps_ref_pic;
|
||||
pic_buffer_t ref_pic;
|
||||
|
||||
ps_ref_pic = ps_dpb_mgr->ps_init_dpb[0][0];
|
||||
ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0]);
|
||||
|
||||
if(NULL == ps_ref_pic->pu1_buf1)
|
||||
if(NULL == ref_pic.pu1_buf1)
|
||||
{
|
||||
ps_ref_pic = ps_dec->ps_cur_pic;
|
||||
ref_pic = *ps_dec->ps_cur_pic;
|
||||
}
|
||||
for(u1_i = u1_L1; u1_i < u1_max_ref_idx_l1; u1_i++)
|
||||
{
|
||||
*ps_ref_pic_buf_lx = *ps_ref_pic;
|
||||
*ps_ref_pic_buf_lx = ref_pic;
|
||||
ps_ref_pic_buf_lx++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1112,17 +1112,17 @@ void ih264d_init_ref_idx_lx_p(dec_struct_t *ps_dec)
|
|||
/* reference list to handle of errors */
|
||||
{
|
||||
UWORD8 u1_i;
|
||||
pic_buffer_t *ps_ref_pic;
|
||||
pic_buffer_t ref_pic;
|
||||
|
||||
ps_ref_pic = ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS;
|
||||
ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS);
|
||||
|
||||
if(NULL == ps_ref_pic->pu1_buf1)
|
||||
if(NULL == ref_pic.pu1_buf1)
|
||||
{
|
||||
ps_ref_pic = ps_dec->ps_cur_pic;
|
||||
ref_pic = *ps_dec->ps_cur_pic;
|
||||
}
|
||||
for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
|
||||
{
|
||||
*ps_ref_pic_buf_lx = *ps_ref_pic;
|
||||
*ps_ref_pic_buf_lx = ref_pic;
|
||||
ps_ref_pic_buf_lx++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1138,17 +1138,17 @@ void ih264d_init_ref_idx_lx_p(dec_struct_t *ps_dec)
|
|||
/* reference list to handle of errors */
|
||||
{
|
||||
UWORD8 u1_i;
|
||||
pic_buffer_t *ps_ref_pic;
|
||||
pic_buffer_t ref_pic;
|
||||
|
||||
ps_ref_pic = ps_dpb_mgr->ps_init_dpb[0][0];
|
||||
ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0]);
|
||||
|
||||
if(NULL == ps_ref_pic->pu1_buf1)
|
||||
if(NULL == ref_pic.pu1_buf1)
|
||||
{
|
||||
ps_ref_pic = ps_dec->ps_cur_pic;
|
||||
ref_pic = *ps_dec->ps_cur_pic;
|
||||
}
|
||||
for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
|
||||
{
|
||||
*ps_ref_pic_buf_lx = *ps_ref_pic;
|
||||
*ps_ref_pic_buf_lx = ref_pic;
|
||||
ps_ref_pic_buf_lx++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "ih264_typedefs.h"
|
||||
#include "ih264_macros.h"
|
||||
#include "ih264_platform_macros.h"
|
||||
#include "ih264_defs.h"
|
||||
#include "ih264d_bitstrm.h"
|
||||
#include "ih264d_structs.h"
|
||||
#include "ih264d_parse_cavlc.h"
|
||||
|
|
@ -44,7 +45,7 @@
|
|||
|
||||
#define IDCT_BLOCK_WIDTH8X8 8
|
||||
|
||||
void ih264d_scaling_list(WORD16 *pi2_scaling_list,
|
||||
WORD32 ih264d_scaling_list(WORD16 *pi2_scaling_list,
|
||||
WORD32 i4_size_of_scalinglist,
|
||||
UWORD8 *pu1_use_default_scaling_matrix_flag,
|
||||
dec_bit_stream_t *ps_bitstrm)
|
||||
|
|
@ -62,6 +63,11 @@ void ih264d_scaling_list(WORD16 *pi2_scaling_list,
|
|||
i4_delta_scale = ih264d_sev(pu4_bitstrm_ofst,
|
||||
pu4_bitstrm_buf);
|
||||
|
||||
if(i4_delta_scale < MIN_H264_DELTA_SCALE ||
|
||||
i4_delta_scale > MAX_H264_DELTA_SCALE)
|
||||
{
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
}
|
||||
i4_nextScale = ((i4_lastScale + i4_delta_scale + 256) & 0xff);
|
||||
|
||||
*pu1_use_default_scaling_matrix_flag = ((i4_j == 0)
|
||||
|
|
@ -72,6 +78,7 @@ void ih264d_scaling_list(WORD16 *pi2_scaling_list,
|
|||
(i4_nextScale == 0) ? (i4_lastScale) : (i4_nextScale);
|
||||
i4_lastScale = pi2_scaling_list[i4_j];
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
WORD32 ih264d_form_default_scaling_matrix(dec_struct_t *ps_dec)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
#ifndef _IH264D_QUANT_SCALING_H_
|
||||
#define _IH264D_QUANT_SCALING_H_
|
||||
void ih264d_scaling_list(WORD16 *pi2_scaling_list,
|
||||
WORD32 ih264d_scaling_list(WORD16 *pi2_scaling_list,
|
||||
WORD32 i4_size_of_scalinglist,
|
||||
UWORD8 *pu1_use_default_scaling_matrix_flag,
|
||||
dec_bit_stream_t *ps_bitstrm);
|
||||
|
|
|
|||
|
|
@ -584,8 +584,6 @@ IH264E_ERROR_T ih264e_entropy(process_ctxt_t *ps_proc)
|
|||
}
|
||||
}
|
||||
}
|
||||
/* Dont execute any further instructions until store synchronization took place */
|
||||
DATA_SYNC();
|
||||
}
|
||||
|
||||
/* Ending bitstream offset for header in bits */
|
||||
|
|
@ -676,6 +674,9 @@ IH264E_ERROR_T ih264e_entropy(process_ctxt_t *ps_proc)
|
|||
DEBUG("entropy status %x", ps_entropy->i4_error_code);
|
||||
}
|
||||
|
||||
/* Dont execute any further instructions until store synchronization took place */
|
||||
DATA_SYNC();
|
||||
|
||||
/* allow threads to dequeue entropy jobs */
|
||||
ps_codec->au4_entropy_thread_active[ctxt_sel] = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue