~thopiekar/arm-mali/libvdpau-sunxi

« back to all changes in this revision

Viewing changes to mpeg4.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:
160
160
        if (ret != VDP_STATUS_OK)
161
161
                return ret;
162
162
 
163
 
        ret = rec_prepare(output);
164
 
        if (ret != VDP_STATUS_OK)
165
 
                return ret;
166
 
 
167
163
        bitstream bs = { .data = cedrus_mem_get_pointer(decoder->data), .length = len, .bitpos = 0 };
168
164
 
169
165
        while (find_startcode(&bs))
184
180
                writel(cedrus_mem_get_bus_addr(decoder_p->ncf_buffer), ve_regs + VE_MPEG_NCF_ADDR);
185
181
 
186
182
                // set output buffers
187
 
                writel(cedrus_mem_get_bus_addr(output->rec), ve_regs + VE_MPEG_REC_LUMA);
188
 
                writel(cedrus_mem_get_bus_addr(output->rec) + output->luma_size, ve_regs + VE_MPEG_REC_CHROMA);
 
183
                writel(cedrus_mem_get_bus_addr(output->yuv->data), ve_regs + VE_MPEG_REC_LUMA);
 
184
                writel(cedrus_mem_get_bus_addr(output->yuv->data) + output->luma_size, ve_regs + VE_MPEG_REC_CHROMA);
189
185
                writel(cedrus_mem_get_bus_addr(output->yuv->data), ve_regs + VE_MPEG_ROT_LUMA);
190
186
                writel(cedrus_mem_get_bus_addr(output->yuv->data) + output->luma_size, ve_regs + VE_MPEG_ROT_CHROMA);
191
187
 
192
188
                // ??
193
189
                writel(0x40620000, ve_regs + VE_MPEG_SDROT_CTRL);
194
190
                if (cedrus_get_ve_version(decoder->device->cedrus) >= 0x1680)
 
191
                {
195
192
                        writel((0x2 << 30) | (0x1 << 28) | (output->chroma_size / 2), ve_regs + VE_EXTRA_OUT_FMT_OFFSET);
 
193
                        writel((0x2 << 4), ve_regs + 0x0ec);
 
194
                        writel(output->chroma_size / 2, ve_regs + 0x0c4);
 
195
                        writel((ALIGN(decoder->width / 2, 16) << 16) | ALIGN(decoder->width, 32), ve_regs + 0x0c8);
 
196
                }
196
197
 
197
198
                // set vop header
198
199
                writel(((hdr.vop_coding_type == VOP_B ? 0x1 : 0x0) << 28)
218
219
                writel(0x0, ve_regs + VE_MPEG_MBA);
219
220
 
220
221
                // enable interrupt, unknown control flags
221
 
                writel(0x80084118 | ((cedrus_get_ve_version(decoder->device->cedrus) < 0x1680) << 7) | ((hdr.vop_coding_type == VOP_P ? 0x1 : 0x0) << 12), ve_regs + VE_MPEG_CTRL);
 
222
                writel(0x80084118 | (1 << 7) | ((hdr.vop_coding_type == VOP_P ? 0x1 : 0x0) << 12), ve_regs + VE_MPEG_CTRL);
222
223
 
223
224
                // set quantization parameter
224
225
                writel(hdr.vop_quant, ve_regs + VE_MPEG_QP_INPUT);
227
228
                if (info->forward_reference != VDP_INVALID_HANDLE)
228
229
                {
229
230
                        video_surface_ctx_t *forward = handle_get(info->forward_reference);
230
 
                        writel(cedrus_mem_get_bus_addr(forward->rec), ve_regs + VE_MPEG_FWD_LUMA);
231
 
                        writel(cedrus_mem_get_bus_addr(forward->rec) + forward->luma_size, ve_regs + VE_MPEG_FWD_CHROMA);
 
231
                        writel(cedrus_mem_get_bus_addr(forward->yuv->data), ve_regs + VE_MPEG_FWD_LUMA);
 
232
                        writel(cedrus_mem_get_bus_addr(forward->yuv->data) + forward->luma_size, ve_regs + VE_MPEG_FWD_CHROMA);
232
233
                }
233
234
                if (info->backward_reference != VDP_INVALID_HANDLE)
234
235
                {
235
236
                        video_surface_ctx_t *backward = handle_get(info->backward_reference);
236
 
                        writel(cedrus_mem_get_bus_addr(backward->rec), ve_regs + VE_MPEG_BACK_LUMA);
237
 
                        writel(cedrus_mem_get_bus_addr(backward->rec) + backward->luma_size, ve_regs + VE_MPEG_BACK_CHROMA);
 
237
                        writel(cedrus_mem_get_bus_addr(backward->yuv->data), ve_regs + VE_MPEG_BACK_LUMA);
 
238
                        writel(cedrus_mem_get_bus_addr(backward->yuv->data) + backward->luma_size, ve_regs + VE_MPEG_BACK_CHROMA);
238
239
                }
239
240
 
240
241
                // set trb/trd