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

Diff of /trunk/xvidcore/src/decoder.c

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

revision 12, Sat Mar 9 14:45:40 2002 UTC revision 41, Wed Mar 20 00:28:02 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 62  Line 62 
62    
63  #include "image/image.h"  #include "image/image.h"
64  #include "image/colorspace.h"  #include "image/colorspace.h"
65    #include "utils/mem_align.h"
66    
67  int decoder_create(XVID_DEC_PARAM * param)  int decoder_create(XVID_DEC_PARAM * param)
68  {  {
69          DECODER * dec;          DECODER * dec;
70    
71          dec = malloc(sizeof(DECODER));          dec = xvid_malloc(sizeof(DECODER), 16);
72          if (dec == NULL)          if (dec == NULL)
73          {          {
74                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
# Line 85  Line 86 
86    
87          if (image_create(&dec->cur, dec->edged_width, dec->edged_height))          if (image_create(&dec->cur, dec->edged_width, dec->edged_height))
88          {          {
89                  free(dec);                  xvid_free(dec);
90                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
91          }          }
92    
93          if (image_create(&dec->refn, dec->edged_width, dec->edged_height))          if (image_create(&dec->refn, dec->edged_width, dec->edged_height))
94          {          {
95                  image_destroy(&dec->cur, dec->edged_width, dec->edged_height);                  image_destroy(&dec->cur, dec->edged_width, dec->edged_height);
96                  free(dec);                  xvid_free(dec);
97                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
98          }          }
99    
100          dec->mbs = malloc(sizeof(MACROBLOCK) * dec->mb_width * dec->mb_height);          dec->mbs = xvid_malloc(sizeof(MACROBLOCK) * dec->mb_width * dec->mb_height, 16);
101          if (dec->mbs == NULL)          if (dec->mbs == NULL)
102          {          {
103                  image_destroy(&dec->cur, dec->edged_width, dec->edged_height);                  image_destroy(&dec->cur, dec->edged_width, dec->edged_height);
104                  free(dec);                  xvid_free(dec);
105                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
106          }          }
107    
# Line 113  Line 114 
114    
115  int decoder_destroy(DECODER * dec)  int decoder_destroy(DECODER * dec)
116  {  {
117          free(dec->mbs);          xvid_free(dec->mbs);
118          image_destroy(&dec->refn, dec->edged_width, dec->edged_height);          image_destroy(&dec->refn, dec->edged_width, dec->edged_height);
119          image_destroy(&dec->cur, dec->edged_width, dec->edged_height);          image_destroy(&dec->cur, dec->edged_width, dec->edged_height);
120          free(dec);          xvid_free(dec);
121    
122          destroy_vlc_tables();          destroy_vlc_tables();
123    

Legend:
Removed from v.12  
changed lines
  Added in v.41

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