[svn] / branches / release-1_3-branch / xvidcore / src / decoder.c Repository:
ViewVC logotype

Diff of /branches/release-1_3-branch/xvidcore/src/decoder.c

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

revision 1772, Mon Apr 16 19:01:28 2007 UTC revision 1891, Tue Aug 10 15:00:34 2010 UTC
# Line 20  Line 20 
20   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
21   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22   *   *
23   * $Id: decoder.c,v 1.80 2007-04-16 19:01:28 Skal Exp $   * $Id: decoder.c,v 1.83 2010-08-10 15:00:34 Isibaar Exp $
24   *   *
25   ****************************************************************************/   ****************************************************************************/
26    
# Line 197  Line 197 
197    dec->time_inc_resolution = 1; /* until VOL header says otherwise */    dec->time_inc_resolution = 1; /* until VOL header says otherwise */
198    dec->ver_id = 1;    dec->ver_id = 1;
199    
200      if (create->fourcc == ((int)('X')|((int)('V')<<8)|
201                             ((int)('I')<<16)|((int)('D')<<24))) { /* XVID */
202        dec->bs_version = 0; /* Initially assume oldest xvid version */
203      }
204      else {
205    dec->bs_version = 0xffff; /* Initialize to very high value -> assume bugfree stream */    dec->bs_version = 0xffff; /* Initialize to very high value -> assume bugfree stream */
206      }
207    
208    dec->fixed_dimensions = (dec->width > 0 && dec->height > 0);    dec->fixed_dimensions = (dec->width > 0 && dec->height > 0);
209    
210    if (dec->fixed_dimensions)    if (dec->fixed_dimensions) {
211      return decoder_resize(dec);      int ret = decoder_resize(dec);
212        if (ret == XVID_ERR_MEMORY) create->handle = NULL;
213        return ret;
214      }
215    else    else
216      return 0;      return 0;
217  }  }
# Line 748  Line 757 
757          bound = read_video_packet_header(bs, dec, 0,          bound = read_video_packet_header(bs, dec, 0,
758                &quant, NULL, NULL, &intra_dc_threshold);                &quant, NULL, NULL, &intra_dc_threshold);
759          x = bound % mb_width;          x = bound % mb_width;
760          y = bound / mb_width;          y = MIN((bound / mb_width), (mb_height-1));
761        }        }
762        mb = &dec->mbs[y * dec->mb_width + x];        mb = &dec->mbs[y * dec->mb_width + x];
763    
# Line 975  Line 984 
984          bound = read_video_packet_header(bs, dec, fcode - 1,          bound = read_video_packet_header(bs, dec, fcode - 1,
985            &quant, &fcode, NULL, &intra_dc_threshold);            &quant, &fcode, NULL, &intra_dc_threshold);
986          x = bound % mb_width;          x = bound % mb_width;
987          y = bound / mb_width;          y = MIN((bound / mb_width), (mb_height-1));
988        }        }
989        mb = &dec->mbs[y * dec->mb_width + x];        mb = &dec->mbs[y * dec->mb_width + x];
990    
# Line 1384  Line 1393 
1393          int bound = read_video_packet_header(bs, dec, resync_len, &quant,          int bound = read_video_packet_header(bs, dec, resync_len, &quant,
1394                             &fcode_forward, &fcode_backward, &intra_dc_threshold);                             &fcode_forward, &fcode_backward, &intra_dc_threshold);
1395          x = bound % dec->mb_width;          x = bound % dec->mb_width;
1396          y = bound / dec->mb_width;          y = MIN((bound / dec->mb_width), (dec->mb_height-1));
1397          /* reset predicted macroblocks */          /* reset predicted macroblocks */
1398          dec->p_fmv = dec->p_bmv = zeromv;          dec->p_fmv = dec->p_bmv = zeromv;
1399          /* update resync len with new fcodes */          /* update resync len with new fcodes */

Legend:
Removed from v.1772  
changed lines
  Added in v.1891

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