media_module: fix issue on h265

PD#167443:
1.fix allocate memory fail: add a judgment statement about the width and height of video.
2.add code to put mv buffer when already got mv buffer and allocation mmu memory failure.

Change-Id: I9934716cbe0157b02b5f64c6a53e73bb8e1d7fc2
Signed-off-by: Peng Yixin <yixin.peng@amlogic.com>
This commit is contained in:
Peng Yixin
2018-06-13 19:40:10 +08:00
committed by Dongjin Kim
parent a7aeb2aa48
commit db300ca1de

View File

@@ -4581,6 +4581,7 @@ static struct PIC_s *get_new_pic(struct hevc_state_s *hevc,
rpm_param->p.bit_depth,
hevc->frame_mmu_map_addr);
if (ret != 0) {
put_mv_buf(hevc, new_pic);
hevc_print(hevc, 0,
"can't alloc need mmu1,idx %d ret =%d\n",
new_pic->decode_idx,
@@ -8251,7 +8252,8 @@ pic_done:
hevc->lcu_size = 1 << (log + 3 + log_s);
hevc->lcu_size_log2 = log2i(hevc->lcu_size);
if (hevc->pic_w == 0 || hevc->pic_h == 0
|| hevc->lcu_size == 0) {
|| hevc->lcu_size == 0
|| OVER_SIZE(hevc->pic_w, hevc->pic_h)) {
/* skip search next start code */
WRITE_VREG(HEVC_WAIT_FLAG, READ_VREG(HEVC_WAIT_FLAG)
& (~0x2));