~thopiekar/arm-mali/libvdpau-sunxi

« back to all changes in this revision

Viewing changes to h264.c

  • Committer: Jens Kuske
  • Date: 2016-12-17 15:42:57 UTC
  • Revision ID: git-v1:ffad9ab982f3c133cb30d2d509f7ef2893744650
Remove unneeded reconstruct buffer

This reverts commit 162bfcc214fa1b6ef64e1d39298dd9dfe3681190
and replaces it by direct non-tiled output.

On H3 and newer all subengines are able to work without any tiled
buffer, not only the H.265 engine. This saves us some memory and
reduces complexity of video surfaces.

Show diffs side-by-side

added added

removed removed

Lines of Context:
675
675
                        writel((uint16_t)c->info->field_order_cnt[0], c->regs + VE_H264_RAM_WRITE_DATA);
676
676
                        writel((uint16_t)c->info->field_order_cnt[1], c->regs + VE_H264_RAM_WRITE_DATA);
677
677
                        writel(output_p->pic_type << 8, c->regs + VE_H264_RAM_WRITE_DATA);
678
 
                        writel(cedrus_mem_get_bus_addr(c->output->rec), c->regs + VE_H264_RAM_WRITE_DATA);
679
 
                        writel(cedrus_mem_get_bus_addr(c->output->rec) + c->output->luma_size, c->regs + VE_H264_RAM_WRITE_DATA);
 
678
                        writel(cedrus_mem_get_bus_addr(c->output->yuv->data), c->regs + VE_H264_RAM_WRITE_DATA);
 
679
                        writel(cedrus_mem_get_bus_addr(c->output->yuv->data) + c->output->luma_size, c->regs + VE_H264_RAM_WRITE_DATA);
680
680
                        writel(cedrus_mem_get_bus_addr(output_p->extra_data), c->regs + VE_H264_RAM_WRITE_DATA);
681
681
                        writel(cedrus_mem_get_bus_addr(output_p->extra_data) + c->video_extra_data_len, c->regs + VE_H264_RAM_WRITE_DATA);
682
682
                        writel(0, c->regs + VE_H264_RAM_WRITE_DATA);
698
698
                        writel(frame_list[i]->top_pic_order_cnt, c->regs + VE_H264_RAM_WRITE_DATA);
699
699
                        writel(frame_list[i]->bottom_pic_order_cnt, c->regs + VE_H264_RAM_WRITE_DATA);
700
700
                        writel(surface_p->pic_type << 8, c->regs + VE_H264_RAM_WRITE_DATA);
701
 
                        writel(cedrus_mem_get_bus_addr(surface->rec), c->regs + VE_H264_RAM_WRITE_DATA);
702
 
                        writel(cedrus_mem_get_bus_addr(surface->rec) + surface->luma_size, c->regs + VE_H264_RAM_WRITE_DATA);
 
701
                        writel(cedrus_mem_get_bus_addr(surface->yuv->data), c->regs + VE_H264_RAM_WRITE_DATA);
 
702
                        writel(cedrus_mem_get_bus_addr(surface->yuv->data) + surface->luma_size, c->regs + VE_H264_RAM_WRITE_DATA);
703
703
                        writel(cedrus_mem_get_bus_addr(surface_p->extra_data), c->regs + VE_H264_RAM_WRITE_DATA);
704
704
                        writel(cedrus_mem_get_bus_addr(surface_p->extra_data) + c->video_extra_data_len, c->regs + VE_H264_RAM_WRITE_DATA);
705
705
                        writel(0, c->regs + VE_H264_RAM_WRITE_DATA);
742
742
        if (ret != VDP_STATUS_OK)
743
743
                return ret;
744
744
 
745
 
        ret = rec_prepare(output);
746
 
        if (ret != VDP_STATUS_OK)
747
 
                return ret;
748
 
 
749
745
        h264_context_t *c = calloc(1, sizeof(h264_context_t));
750
746
        c->picture_width_in_mbs_minus1 = (decoder->width - 1) / 16;
751
747
        if (!info->frame_mbs_only_flag)
806
802
        writel(0x00000000, c->regs + VE_H264_SDROT_CTRL);
807
803
        if (cedrus_get_ve_version(decoder->device->cedrus) >= 0x1680)
808
804
        {
809
 
                writel(cedrus_mem_get_bus_addr(c->output->yuv->data), c->regs + VE_H264_SDROT_LUMA);
810
 
                writel(cedrus_mem_get_bus_addr(c->output->yuv->data) + c->output->luma_size, c->regs + VE_H264_SDROT_CHROMA);
811
 
                writel((0x2 << 30) | (0x1 << 28) | (c->output->chroma_size / 2), c->regs + VE_EXTRA_OUT_FMT_OFFSET);
 
805
                writel((0x2 << 4), c->regs + 0x0ec);
 
806
                writel(c->output->chroma_size / 2, c->regs + 0x0c4);
 
807
                writel((ALIGN(decoder->width / 2, 16) << 16) | ALIGN(decoder->width, 32), c->regs + 0x0c8);
812
808
        }
813
809
 
814
810
        if (!fill_frame_lists(c))
834
830
                }
835
831
 
836
832
                // Enable startcode detect and ??
837
 
                writel((0x1 << 25) | (0x1 << 10) | ((cedrus_get_ve_version(decoder->device->cedrus) >= 0x1680) << 9), c->regs + VE_H264_CTRL);
 
833
                writel((0x1 << 25) | (0x1 << 10), c->regs + VE_H264_CTRL);
838
834
 
839
835
                // input buffer
840
836
                writel((len - pos) * 8, c->regs + VE_H264_VLD_LEN);