24 #define MAY_BE_MPEG12 1
25 #define DEFINITELY_MPEG12 2
29 int16_t *
block,
int i, uint8_t *dest,
int line_size,
int qscale)
31 s->dct_unquantize_intra(
s,
block,
i, qscale);
32 s->idsp.idct_put(dest, line_size,
block);
36 int16_t *
block,
int i, uint8_t *dest,
int line_size,
int qscale)
38 if (
s->block_last_index[
i] >= 0) {
39 s->dct_unquantize_inter(
s,
block,
i, qscale);
41 s->idsp.idct_add(dest, line_size,
block);
57 int lowres_flag,
int is_mpeg12)
59 #define IS_MPEG12(s) (is_mpeg12 == MAY_BE_MPEG12 ? ((s)->out_format == FMT_MPEG1) : is_mpeg12)
60 const int mb_xy =
s->mb_y *
s->mb_stride +
s->mb_x;
62 s->current_picture.qscale_table[mb_xy] =
s->qscale;
67 if (
s->mbintra_table[mb_xy])
72 s->last_dc[2] = 128 <<
s->intra_dc_precision;
75 s->mbintra_table[mb_xy] = 1;
83 uint8_t *dest_y, *dest_cb, *dest_cr;
84 int dct_linesize, dct_offset;
85 const int linesize =
s->current_picture.f->linesize[0];
86 const int uvlinesize =
s->current_picture.f->linesize[1];
88 const int block_size = lowres_flag ? 8 >>
s->avctx->lowres : 8;
93 uint8_t *mbskip_ptr = &
s->mbskip_table[mb_xy];
99 }
else if(!
s->current_picture.reference) {
106 dct_linesize = linesize <<
s->interlaced_dct;
107 dct_offset =
s->interlaced_dct ? linesize : linesize * block_size;
111 dest_cb =
s->dest[1];
112 dest_cr =
s->dest[2];
114 dest_y =
s->sc.b_scratchpad;
115 dest_cb =
s->sc.b_scratchpad + 16 * linesize;
116 dest_cr =
s->sc.b_scratchpad + 32 * linesize;
141 op_pix =
s->h264chroma.avg_h264_chroma_pixels_tab;
151 op_pix =
s->hdsp.put_pixels_tab;
152 op_qpix =
s->qdsp.put_qpel_pixels_tab;
154 op_pix =
s->hdsp.put_no_rnd_pixels_tab;
155 op_qpix =
s->qdsp.put_no_rnd_qpel_pixels_tab;
158 ff_mpv_motion(
s, dest_y, dest_cb, dest_cr, 0,
s->last_picture.f->data, op_pix, op_qpix);
159 op_pix =
s->hdsp.avg_pixels_tab;
160 op_qpix =
s->qdsp.avg_qpel_pixels_tab;
163 ff_mpv_motion(
s, dest_y, dest_cb, dest_cr, 1,
s->next_picture.f->data, op_pix, op_qpix);
168 if (
s->avctx->skip_idct) {
186 if (
s->chroma_y_shift) {
204 add_dct(
s,
block[3], 3, dest_y + dct_offset + block_size, dct_linesize);
207 if (
s->chroma_y_shift) {
212 dct_linesize = uvlinesize <<
s->interlaced_dct;
213 dct_offset =
s->interlaced_dct ? uvlinesize : uvlinesize*block_size;
219 if (!
s->chroma_x_shift) {
222 add_dct(
s,
block[10], 10, dest_cb+block_size+dct_offset, dct_linesize);
223 add_dct(
s,
block[11], 11, dest_cr+block_size+dct_offset, dct_linesize);
227 }
else if (CONFIG_WMV2_DECODER) {
237 s->avctx->bits_per_raw_sample > 8) {
239 uvlinesize, dct_linesize, dct_offset);
245 put_dct(
s,
block[1], 1, dest_y + block_size, dct_linesize,
s->qscale);
246 put_dct(
s,
block[2], 2, dest_y + dct_offset , dct_linesize,
s->qscale);
247 put_dct(
s,
block[3], 3, dest_y + dct_offset + block_size, dct_linesize,
s->qscale);
250 if (
s->chroma_y_shift) {
258 put_dct(
s,
block[6], 6, dest_cb + dct_offset, dct_linesize,
s->chroma_qscale);
259 put_dct(
s,
block[7], 7, dest_cr + dct_offset, dct_linesize,
s->chroma_qscale);
265 s->idsp.idct_put(dest_y, dct_linesize,
block[0]);
266 s->idsp.idct_put(dest_y + block_size, dct_linesize,
block[1]);
267 s->idsp.idct_put(dest_y + dct_offset, dct_linesize,
block[2]);
268 s->idsp.idct_put(dest_y + dct_offset + block_size, dct_linesize,
block[3]);
271 if (
s->chroma_y_shift) {
272 s->idsp.idct_put(dest_cb, uvlinesize,
block[4]);
273 s->idsp.idct_put(dest_cr, uvlinesize,
block[5]);
275 dct_linesize = uvlinesize <<
s->interlaced_dct;
276 dct_offset =
s->interlaced_dct ? uvlinesize : uvlinesize*block_size;
278 s->idsp.idct_put(dest_cb, dct_linesize,
block[4]);
279 s->idsp.idct_put(dest_cr, dct_linesize,
block[5]);
280 s->idsp.idct_put(dest_cb + dct_offset, dct_linesize,
block[6]);
281 s->idsp.idct_put(dest_cr + dct_offset, dct_linesize,
block[7]);
282 if (!
s->chroma_x_shift) {
283 s->idsp.idct_put(dest_cb + block_size, dct_linesize,
block[8]);
284 s->idsp.idct_put(dest_cr + block_size, dct_linesize,
block[9]);
285 s->idsp.idct_put(dest_cb + block_size + dct_offset, dct_linesize,
block[10]);
286 s->idsp.idct_put(dest_cr + block_size + dct_offset, dct_linesize,
block[11]);
294 s->hdsp.put_pixels_tab[0][0](
s->dest[0], dest_y, linesize, 16);
296 s->hdsp.put_pixels_tab[
s->chroma_x_shift][0](
s->dest[1], dest_cb, uvlinesize, 16 >>
s->chroma_y_shift);
297 s->hdsp.put_pixels_tab[
s->chroma_x_shift][0](
s->dest[2], dest_cr, uvlinesize, 16 >>
s->chroma_y_shift);