[cvs] / xvidcore / src / decoder.c Repository:
ViewVC logotype

Diff of /xvidcore/src/decoder.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1, Fri Mar 8 02:44:29 2002 UTC revision 1.9, Thu Apr 4 13:58:06 2002 UTC
# Line 12  Line 12 
12   *      editors and their companies, will have no liability for use of this   *      editors and their companies, will have no liability for use of this
13   *      software or modifications or derivatives thereof.   *      software or modifications or derivatives thereof.
14   *   *
15   *      This program is free software; you can redistribute it and/or modify   *      This program is xvid_free software; you can redistribute it and/or modify
16   *      it under the terms of the GNU General Public License as published by   *      it under the terms of the GNU General Public License as published by
17   *      the Free Software Foundation; either version 2 of the License, or   *      the xvid_free Software Foundation; either version 2 of the License, or
18   *      (at your option) any later version.   *      (at your option) any later version.
19   *   *
20   *      This program is distributed in the hope that it will be useful,   *      This program is distributed in the hope that it will be useful,
# Line 23  Line 23 
23   *      GNU General Public License for more details.   *      GNU General Public License for more details.
24   *   *
25   *      You should have received a copy of the GNU General Public License   *      You should have received a copy of the GNU General Public License
26   *      along with this program; if not, write to the Free Software   *      along with this program; if not, write to the xvid_free Software
27   *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28   *   *
29   *************************************************************************/   *************************************************************************/
# Line 32  Line 32 
32   *   *
33   *      History:   *      History:
34   *   *
35     *  29.03.2002  interlacing fix - compensated block wasn't being used when
36     *              reconstructing blocks, thus artifacts
37     *              interlacing speedup - used transfers to re-interlace
38     *              interlaced decoding should be as fast as progressive now
39     *  26.03.2002  interlacing support - moved transfers outside decode loop
40   *      26.12.2001      decoder_mbinter: dequant/idct moved within if(coded) block   *      26.12.2001      decoder_mbinter: dequant/idct moved within if(coded) block
41   *      22.12.2001      block based interpolation   *      22.12.2001      block based interpolation
42   *      01.12.2001      inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>   *      01.12.2001      inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>
# Line 62  Line 67 
67    
68  #include "image/image.h"  #include "image/image.h"
69  #include "image/colorspace.h"  #include "image/colorspace.h"
70    #include "utils/mem_align.h"
71    
72  int decoder_create(XVID_DEC_PARAM * param)  int decoder_create(XVID_DEC_PARAM * param)
73  {  {
74          DECODER * dec;          DECODER * dec;
75    
76          dec = malloc(sizeof(DECODER));          dec = xvid_malloc(sizeof(DECODER), CACHE_LINE);
77          if (dec == NULL)          if (dec == NULL)
78          {          {
79                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
# Line 85  Line 91 
91    
92          if (image_create(&dec->cur, dec->edged_width, dec->edged_height))          if (image_create(&dec->cur, dec->edged_width, dec->edged_height))
93          {          {
94                  free(dec);                  xvid_free(dec);
95                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
96          }          }
97    
98          if (image_create(&dec->refn, dec->edged_width, dec->edged_height))          if (image_create(&dec->refn, dec->edged_width, dec->edged_height))
99          {          {
100                  image_destroy(&dec->cur, dec->edged_width, dec->edged_height);                  image_destroy(&dec->cur, dec->edged_width, dec->edged_height);
101                  free(dec);                  xvid_free(dec);
102                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
103          }          }
104    
105          dec->mbs = malloc(sizeof(MACROBLOCK) * dec->mb_width * dec->mb_height);          dec->mbs = xvid_malloc(sizeof(MACROBLOCK) * dec->mb_width * dec->mb_height, CACHE_LINE);
106          if (dec->mbs == NULL)          if (dec->mbs == NULL)
107          {          {
108                  image_destroy(&dec->cur, dec->edged_width, dec->edged_height);                  image_destroy(&dec->cur, dec->edged_width, dec->edged_height);
109                  free(dec);                  xvid_free(dec);
110                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
111          }          }
112    
113          init_timer();          init_timer();
         create_vlc_tables();  
114    
115          return XVID_ERR_OK;          return XVID_ERR_OK;
116  }  }
# Line 113  Line 118 
118    
119  int decoder_destroy(DECODER * dec)  int decoder_destroy(DECODER * dec)
120  {  {
121          free(dec->mbs);          xvid_free(dec->mbs);
122          image_destroy(&dec->refn, dec->edged_width, dec->edged_height);          image_destroy(&dec->refn, dec->edged_width, dec->edged_height);
123          image_destroy(&dec->cur, dec->edged_width, dec->edged_height);          image_destroy(&dec->cur, dec->edged_width, dec->edged_height);
124          free(dec);          xvid_free(dec);
   
         destroy_vlc_tables();  
125    
126          write_timer();          write_timer();
127          return XVID_ERR_OK;          return XVID_ERR_OK;
# Line 134  Line 137 
137    
138  // decode an intra macroblock  // decode an intra macroblock
139    
140  void decoder_mbintra(DECODER * dec, MACROBLOCK * mb, int x, int y, uint32_t acpred_flag, uint32_t cbp, Bitstream * bs, int quant, int intra_dc_threshold)  void decoder_mbintra(DECODER * dec,
141  {                       MACROBLOCK * pMB,
142          uint32_t k;                       const uint32_t x_pos,
143                         const uint32_t y_pos,
144                         const uint32_t acpred_flag,
145                         const uint32_t cbp,
146                         Bitstream * bs,
147                         const uint32_t quant,
148                         const uint32_t intra_dc_threshold)
149    {
150    
151            DECLARE_ALIGNED_MATRIX(block, 6, 64, int16_t, CACHE_LINE);
152            DECLARE_ALIGNED_MATRIX(data,  6, 64, int16_t, CACHE_LINE);
153    
154            uint32_t stride = dec->edged_width;
155            uint32_t stride2 = stride / 2;
156            uint32_t next_block = stride * 8;
157            uint32_t i;
158            uint32_t iQuant = pMB->quant;
159            uint8_t *pY_Cur, *pU_Cur, *pV_Cur;
160    
161            pY_Cur = dec->cur.y + (y_pos << 4) * stride + (x_pos << 4);
162            pU_Cur = dec->cur.u + (y_pos << 3) * stride2 + (x_pos << 3);
163            pV_Cur = dec->cur.v + (y_pos << 3) * stride2 + (x_pos << 3);
164    
165          for (k = 0; k < 6; k++)          memset(block, 0, 6*64*sizeof(int16_t));         // clear
166    
167            for (i = 0; i < 6; i++)
168          {          {
169                  uint32_t dcscalar;                  uint32_t iDcScaler = get_dc_scaler(iQuant, i < 4);
                 int16_t block[64];  
                 int16_t data[64];  
170                  int16_t predictors[8];                  int16_t predictors[8];
171                  int start_coeff;                  int start_coeff;
172    
                 dcscalar = get_dc_scaler(mb->quant, k < 4);  
   
173                  start_timer();                  start_timer();
174                  predict_acdc(dec->mbs, x, y, dec->mb_width, k, block, mb->quant, dcscalar, predictors);                  predict_acdc(dec->mbs, x_pos, y_pos, dec->mb_width, i, &block[i*64], iQuant, iDcScaler, predictors);
175                  if (!acpred_flag)                  if (!acpred_flag)
176                  {                  {
177                          mb->acpred_directions[k] = 0;                          pMB->acpred_directions[i] = 0;
178                  }                  }
179                  stop_prediction_timer();                  stop_prediction_timer();
180    
                 memset(block, 0, 64*sizeof(int16_t));           // clear  
   
181                  if (quant < intra_dc_threshold)                  if (quant < intra_dc_threshold)
182                  {                  {
183                          int dc_size;                          int dc_size;
184                          int dc_dif;                          int dc_dif;
185    
186                          dc_size = k < 4 ?  get_dc_size_lum(bs) : get_dc_size_chrom(bs);                          dc_size = i < 4 ?  get_dc_size_lum(bs) : get_dc_size_chrom(bs);
187                          dc_dif = dc_size ? get_dc_dif(bs, dc_size) : 0 ;                          dc_dif = dc_size ? get_dc_dif(bs, dc_size) : 0 ;
188    
189                          if (dc_size > 8)                          if (dc_size > 8)
# Line 171  Line 191 
191                                  BitstreamSkip(bs, 1);           // marker                                  BitstreamSkip(bs, 1);           // marker
192                          }                          }
193    
194                          block[0] = dc_dif;                          block[i*64 + 0] = dc_dif;
195                          start_coeff = 1;                          start_coeff = 1;
196                  }                  }
197                  else                  else
# Line 180  Line 200 
200                  }                  }
201    
202                  start_timer();                  start_timer();
203                  if (cbp & (1 << (5-k)))                 // coded                  if (cbp & (1 << (5-i)))                 // coded
204                  {                  {
205                          get_intra_block(bs, block, mb->acpred_directions[k], start_coeff);                          get_intra_block(bs, &block[i*64], pMB->acpred_directions[i], start_coeff);
206                  }                  }
207                  stop_coding_timer();                  stop_coding_timer();
208    
209                  start_timer();                  start_timer();
210                  add_acdc(mb, k, block, dcscalar, predictors);                  add_acdc(pMB, i, &block[i*64], iDcScaler, predictors);
211                  stop_prediction_timer();                  stop_prediction_timer();
212    
213                  start_timer();                  start_timer();
214                  if (dec->quant_type == 0)                  if (dec->quant_type == 0)
215                  {                  {
216                          dequant_intra(data, block, mb->quant, dcscalar);                          dequant_intra(&data[i*64], &block[i*64], iQuant, iDcScaler);
217                  }                  }
218                  else                  else
219                  {                  {
220                          dequant4_intra(data, block, mb->quant, dcscalar);                          dequant4_intra(&data[i*64], &block[i*64], iQuant, iDcScaler);
221                  }                  }
222                  stop_iquant_timer();                  stop_iquant_timer();
223    
224                  start_timer();                  start_timer();
225                  idct(data);                  idct(&data[i*64]);
226                  stop_idct_timer();                  stop_idct_timer();
   
                 start_timer();  
                 if (k < 4)  
                 {  
                         transfer_16to8copy(dec->cur.y + (16*y*dec->edged_width) + 16*x + (4*(k&2)*dec->edged_width) + 8*(k&1), data, dec->edged_width);  
                 }  
                 else if (k == 4)  
                 {  
                         transfer_16to8copy(dec->cur.u+ 8*y*(dec->edged_width/2) + 8*x, data, (dec->edged_width/2));  
227                  }                  }
228                  else    // if (k == 5)  
229            if (pMB->field_dct)
230                  {                  {
231                          transfer_16to8copy(dec->cur.v + 8*y*(dec->edged_width/2) + 8*x, data, (dec->edged_width/2));                  next_block = stride;
232                    stride *= 2;
233                  }                  }
234    
235            start_timer();
236            transfer_16to8copy(pY_Cur,                  &data[0*64], stride);
237            transfer_16to8copy(pY_Cur + 8,              &data[1*64], stride);
238            transfer_16to8copy(pY_Cur + next_block,     &data[2*64], stride);
239            transfer_16to8copy(pY_Cur + 8 + next_block, &data[3*64], stride);
240            transfer_16to8copy(pU_Cur,                  &data[4*64], stride2);
241            transfer_16to8copy(pV_Cur,                  &data[5*64], stride2);
242                  stop_transfer_timer();                  stop_transfer_timer();
243          }          }
 }  
244    
245    
246    
# Line 234  Line 254 
254    
255  // decode an inter macroblock  // decode an inter macroblock
256    
257  void decoder_mbinter(DECODER * dec, MACROBLOCK * mb, int x, int y, uint32_t acpred_flag, uint32_t cbp, Bitstream * bs, int quant, int rounding)  void decoder_mbinter(DECODER * dec,
258  {                       const MACROBLOCK * pMB,
259          const uint32_t stride = dec->edged_width;                       const uint32_t x_pos,
260          const uint32_t stride2 = dec->edged_width / 2;                       const uint32_t y_pos,
261                         const uint32_t acpred_flag,
262                         const uint32_t cbp,
263                         Bitstream * bs,
264                         const uint32_t quant,
265                         const uint32_t rounding)
266    {
267    
268            DECLARE_ALIGNED_MATRIX(block,6, 64, int16_t, CACHE_LINE);
269            DECLARE_ALIGNED_MATRIX(data, 6, 64, int16_t, CACHE_LINE);
270    
271            uint32_t stride = dec->edged_width;
272            uint32_t stride2 = stride / 2;
273            uint32_t next_block = stride * 8;
274            uint32_t i;
275            uint32_t iQuant = pMB->quant;
276            uint8_t *pY_Cur, *pU_Cur, *pV_Cur;
277          int uv_dx, uv_dy;          int uv_dx, uv_dy;
         uint32_t k;  
278    
279          if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q)          pY_Cur = dec->cur.y + (y_pos << 4) * stride + (x_pos << 4);
280            pU_Cur = dec->cur.u + (y_pos << 3) * stride2 + (x_pos << 3);
281            pV_Cur = dec->cur.v + (y_pos << 3) * stride2 + (x_pos << 3);
282    
283            if (pMB->mode == MODE_INTER || pMB->mode == MODE_INTER_Q)
284          {          {
285                  uv_dx = mb->mvs[0].x;                  uv_dx = pMB->mvs[0].x;
286                  uv_dy = mb->mvs[0].y;                  uv_dy = pMB->mvs[0].y;
287    
288                  uv_dx = (uv_dx & 3) ? (uv_dx >> 1) | 1 : uv_dx / 2;                  uv_dx = (uv_dx & 3) ? (uv_dx >> 1) | 1 : uv_dx / 2;
289                  uv_dy = (uv_dy & 3) ? (uv_dy >> 1) | 1 : uv_dy / 2;                  uv_dy = (uv_dy & 3) ? (uv_dy >> 1) | 1 : uv_dy / 2;
# Line 252  Line 291 
291          else          else
292          {          {
293                  int sum;                  int sum;
294                  sum = mb->mvs[0].x + mb->mvs[1].x + mb->mvs[2].x + mb->mvs[3].x;                  sum = pMB->mvs[0].x + pMB->mvs[1].x + pMB->mvs[2].x + pMB->mvs[3].x;
295                  uv_dx = (sum == 0 ? 0 : SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) );                  uv_dx = (sum == 0 ? 0 : SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) );
296    
297                  sum = mb->mvs[0].y + mb->mvs[1].y + mb->mvs[2].y + mb->mvs[3].y;                  sum = pMB->mvs[0].y + pMB->mvs[1].y + pMB->mvs[2].y + pMB->mvs[3].y;
298                  uv_dy = (sum == 0 ? 0 : SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) );                  uv_dy = (sum == 0 ? 0 : SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) );
299          }          }
300    
301          start_timer();          start_timer();
302          interpolate8x8_switch(dec->cur.y, dec->refn.y, 16*x,     16*y    , mb->mvs[0].x, mb->mvs[0].y, stride,  rounding);          interpolate8x8_switch(dec->cur.y, dec->refn.y, 16*x_pos,     16*y_pos    , pMB->mvs[0].x, pMB->mvs[0].y, stride,  rounding);
303          interpolate8x8_switch(dec->cur.y, dec->refn.y, 16*x + 8, 16*y    , mb->mvs[1].x, mb->mvs[1].y, stride,  rounding);          interpolate8x8_switch(dec->cur.y, dec->refn.y, 16*x_pos + 8, 16*y_pos    , pMB->mvs[1].x, pMB->mvs[1].y, stride,  rounding);
304          interpolate8x8_switch(dec->cur.y, dec->refn.y, 16*x,     16*y + 8, mb->mvs[2].x, mb->mvs[2].y, stride,  rounding);          interpolate8x8_switch(dec->cur.y, dec->refn.y, 16*x_pos,     16*y_pos + 8, pMB->mvs[2].x, pMB->mvs[2].y, stride,  rounding);
305          interpolate8x8_switch(dec->cur.y, dec->refn.y, 16*x + 8, 16*y + 8, mb->mvs[3].x, mb->mvs[3].y, stride,  rounding);          interpolate8x8_switch(dec->cur.y, dec->refn.y, 16*x_pos + 8, 16*y_pos + 8, pMB->mvs[3].x, pMB->mvs[3].y, stride,  rounding);
306          interpolate8x8_switch(dec->cur.u, dec->refn.u, 8*x, 8*y, uv_dx, uv_dy, stride2, rounding);          interpolate8x8_switch(dec->cur.u, dec->refn.u, 8*x_pos,      8*y_pos,      uv_dx,         uv_dy,         stride2, rounding);
307          interpolate8x8_switch(dec->cur.v, dec->refn.v, 8*x, 8*y, uv_dx, uv_dy, stride2, rounding);          interpolate8x8_switch(dec->cur.v, dec->refn.v, 8*x_pos,      8*y_pos,      uv_dx,         uv_dy,         stride2, rounding);
308          stop_comp_timer();          stop_comp_timer();
309    
310            for (i = 0; i < 6; i++)
         for (k = 0; k < 6; k++)  
311          {          {
312                  int16_t block[64];                  if (cbp & (1 << (5-i)))                 // coded
                 int16_t data[64];  
   
                 if (cbp & (1 << (5-k)))                 // coded  
313                  {                  {
314                          memset(block, 0, 64 * sizeof(int16_t));         // clear                          memset(&block[i*64], 0, 64 * sizeof(int16_t));          // clear
315    
316                          start_timer();                          start_timer();
317                          get_inter_block(bs, block);                          get_inter_block(bs, &block[i*64]);
318                          stop_coding_timer();                          stop_coding_timer();
319    
320                          start_timer();                          start_timer();
321                          if (dec->quant_type == 0)                          if (dec->quant_type == 0)
322                          {                          {
323                                  dequant_inter(data, block, mb->quant);                                  dequant_inter(&data[i*64], &block[i*64], iQuant);
324                          }                          }
325                          else                          else
326                          {                          {
327                                  dequant4_inter(data, block, mb->quant);                                  dequant4_inter(&data[i*64], &block[i*64], iQuant);
328                          }                          }
329                          stop_iquant_timer();                          stop_iquant_timer();
330    
331                          start_timer();                          start_timer();
332                          idct(data);                          idct(&data[i*64]);
333                          stop_idct_timer();                          stop_idct_timer();
   
                         start_timer();  
                         if (k < 4)  
                         {  
                                 transfer_16to8add(dec->cur.y + (16*y + 4*(k&2))*stride + 16*x + 8*(k&1), data, stride);  
334                          }                          }
                         else if (k == 4)  
                         {  
                                 transfer_16to8add(dec->cur.u + 8*y*stride2 + 8*x, data, stride2);  
335                          }                          }
336                          else // k == 5  
337            if (pMB->field_dct)
338                          {                          {
339                                  transfer_16to8add(dec->cur.v + 8*y*stride2 + 8*x, data, stride2);                  next_block = stride;
340                    stride *= 2;
341                          }                          }
342    
343            start_timer();
344            if (cbp & 32)
345                    transfer_16to8add(pY_Cur,                  &data[0*64], stride);
346            if (cbp & 16)
347                    transfer_16to8add(pY_Cur + 8,              &data[1*64], stride);
348            if (cbp & 8)
349                    transfer_16to8add(pY_Cur + next_block,     &data[2*64], stride);
350            if (cbp & 4)
351                    transfer_16to8add(pY_Cur + 8 + next_block, &data[3*64], stride);
352            if (cbp & 2)
353                    transfer_16to8add(pU_Cur,                  &data[4*64], stride2);
354            if (cbp & 1)
355                    transfer_16to8add(pV_Cur,                  &data[5*64], stride2);
356                          stop_transfer_timer();                          stop_transfer_timer();
357                  }                  }
         }  
 }  
   
358    
359    
360  void decoder_iframe(DECODER * dec, Bitstream * bs, int quant, int intra_dc_threshold)  void decoder_iframe(DECODER * dec, Bitstream * bs, int quant, int intra_dc_threshold)
361  {  {
362    
363          uint32_t x, y;          uint32_t x, y;
364    
365          for (y = 0; y < dec->mb_height; y++)          for (y = 0; y < dec->mb_height; y++)
# Line 362  Line 403 
403                          }                          }
404                          mb->quant = quant;                          mb->quant = quant;
405    
406                            if (dec->interlacing)
407                            {
408                                    mb->field_dct = BitstreamGetBit(bs);
409                                    DEBUG1("deci: field_dct: ", mb->field_dct);
410                            }
411    
412                          decoder_mbintra(dec, mb, x, y, acpred_flag, cbp, bs, quant, intra_dc_threshold);                          decoder_mbintra(dec, mb, x, y, acpred_flag, cbp, bs, quant, intra_dc_threshold);
413                  }                  }
414          }          }
415    
416  }  }
417    
418    
419  void get_motion_vector(DECODER *dec, Bitstream *bs, int x, int y, int k, VECTOR * mv, int fcode)  void get_motion_vector(DECODER *dec, Bitstream *bs, int x, int y, int k, VECTOR * mv, int fcode)
420  {  {
421    
422          int scale_fac = 1 << (fcode - 1);          int scale_fac = 1 << (fcode - 1);
423          int high = (32 * scale_fac) - 1;          int high = (32 * scale_fac) - 1;
424          int low = ((-32) * scale_fac);          int low = ((-32) * scale_fac);
# Line 420  Line 468 
468    
469  void decoder_pframe(DECODER * dec, Bitstream * bs, int rounding, int quant, int fcode, int intra_dc_threshold)  void decoder_pframe(DECODER * dec, Bitstream * bs, int rounding, int quant, int fcode, int intra_dc_threshold)
470  {  {
471    
472          uint32_t x, y;          uint32_t x, y;
473    
474          image_swap(&dec->cur, &dec->refn);          image_swap(&dec->cur, &dec->refn);
475    
476          start_timer();          start_timer();
477          image_setedges(&dec->refn, dec->edged_width, dec->edged_height, dec->width, dec->height);          image_setedges(&dec->refn, dec->edged_width, dec->edged_height, dec->width, dec->height, dec->interlacing);
478          stop_edges_timer();          stop_edges_timer();
479    
480          for (y = 0; y < dec->mb_height; y++)          for (y = 0; y < dec->mb_height; y++)
# Line 446  Line 495 
495                                  mcbpc = get_mcbpc_inter(bs);                                  mcbpc = get_mcbpc_inter(bs);
496                                  mb->mode = mcbpc & 7;                                  mb->mode = mcbpc & 7;
497                                  cbpc = (mcbpc >> 4);                                  cbpc = (mcbpc >> 4);
498                                    acpred_flag = 0;
499    
500                                  intra = (mb->mode == MODE_INTRA || mb->mode == MODE_INTRA_Q);                                  intra = (mb->mode == MODE_INTRA || mb->mode == MODE_INTRA_Q);
501    
# Line 477  Line 527 
527                                  }                                  }
528                                  mb->quant = quant;                                  mb->quant = quant;
529    
530                                    if (dec->interlacing)
531                                    {
532                                            mb->field_dct = BitstreamGetBit(bs);
533                                            DEBUG1("decp: field_dct: ", mb->field_dct);
534    
535                                  if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q)                                  if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q)
536                                  {                                  {
537                                                    mb->field_pred = BitstreamGetBit(bs);
538                                                    DEBUG1("decp: field_pred: ", mb->field_pred);
539    
540                                                    if (mb->field_pred)
541                                                    {
542                                                            mb->field_for_top = BitstreamGetBit(bs);
543                                                            DEBUG1("decp: field_for_top: ", mb->field_for_top);
544                                                            mb->field_for_bot = BitstreamGetBit(bs);
545                                                            DEBUG1("decp: field_for_bot: ", mb->field_for_bot);
546                                                    }
547                                            }
548                                    }
549    
550                                    if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q)
551                                    {
552                                            if (dec->interlacing && mb->field_pred)
553                                            {
554                                                    get_motion_vector(dec, bs, x, y, 0, &mb->mvs[0], fcode);
555                                                    get_motion_vector(dec, bs, x, y, 0, &mb->mvs[1], fcode);
556                                            }
557                                            else
558                                            {
559                                          get_motion_vector(dec, bs, x, y, 0, &mb->mvs[0], fcode);                                          get_motion_vector(dec, bs, x, y, 0, &mb->mvs[0], fcode);
560                                          mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = mb->mvs[0].x;                                          mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = mb->mvs[0].x;
561                                          mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = mb->mvs[0].y;                                          mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = mb->mvs[0].y;
562                                  }                                  }
563                                    }
564                                  else if (mb->mode == MODE_INTER4V /* || mb->mode == MODE_INTER4V_Q */)                                  else if (mb->mode == MODE_INTER4V /* || mb->mode == MODE_INTER4V_Q */)
565                                  {                                  {
566                                          get_motion_vector(dec, bs, x, y, 0, &mb->mvs[0], fcode);                                          get_motion_vector(dec, bs, x, y, 0, &mb->mvs[0], fcode);
# Line 544  Line 621 
621    
622  int decoder_decode(DECODER * dec, XVID_DEC_FRAME * frame)  int decoder_decode(DECODER * dec, XVID_DEC_FRAME * frame)
623  {  {
624    
625          Bitstream bs;          Bitstream bs;
626          uint32_t rounding;          uint32_t rounding;
627          uint32_t quant;          uint32_t quant;
# Line 587  Line 665 
665          stop_global_timer();          stop_global_timer();
666    
667          return XVID_ERR_OK;          return XVID_ERR_OK;
668    
669  }  }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.9

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4