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

Diff of /trunk/xvidcore/vfw/src/codec.c

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

revision 1933, Thu Dec 30 22:08:02 2010 UTC revision 2020, Tue Jun 21 07:53:07 2011 UTC
# Line 19  Line 19 
19   *      along with this program; if not, write to the Free Software   *      along with this program; if not, write to the Free Software
20   *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21   *   *
22   * $Id: codec.c,v 1.31 2010-12-30 22:08:02 Isibaar Exp $   * $Id$
23   *   *
24   *************************************************************************/   *************************************************************************/
25    
# Line 159  Line 159 
159                  return ICERR_BADFORMAT;                  return ICERR_BADFORMAT;
160          }          }
161    
162            if ((inhdr->biWidth % 4) || (inhdr->biHeight % 4))
163            {
164                    return ICERR_BADFORMAT;
165            }
166    
167          if (lpbiOutput == NULL)          if (lpbiOutput == NULL)
168          {          {
169                  return ICERR_OK;                  return ICERR_OK;
# Line 608  Line 613 
613      if ((profiles[codec->config.profile].flags & PROFILE_EXTRA))      if ((profiles[codec->config.profile].flags & PROFILE_EXTRA))
614        create.global |= XVID_GLOBAL_DIVX5_USERDATA;        create.global |= XVID_GLOBAL_DIVX5_USERDATA;
615    
616            if ((profiles[codec->config.profile].flags & PROFILE_EXTRA) ||
617                    (profiles[codec->config.profile].flags & PROFILE_XVID)) {
618              create.frame_drop_ratio = 0;
619            } else {
620          create.frame_drop_ratio = quality_preset->frame_drop_ratio;          create.frame_drop_ratio = quality_preset->frame_drop_ratio;
621            }
622    
623          switch(codec->xvid_encore_func(0, XVID_ENC_CREATE, &create, NULL))          switch(codec->xvid_encore_func(0, XVID_ENC_CREATE, &create, NULL))
624          {          {
# Line 919  Line 929 
929  {  {
930          BITMAPINFOHEADER * inhdr = &lpbiInput->bmiHeader;          BITMAPINFOHEADER * inhdr = &lpbiInput->bmiHeader;
931          BITMAPINFOHEADER * outhdr = &lpbiOutput->bmiHeader;          BITMAPINFOHEADER * outhdr = &lpbiOutput->bmiHeader;
932            int in_csp = XVID_CSP_NULL, out_csp = XVID_CSP_NULL;
933    
934          if (lpbiInput == NULL)          if (lpbiInput == NULL)
935          {          {
936                  return ICERR_ERROR;                  return ICERR_ERROR;
937          }          }
938    
939          if (inhdr->biCompression != FOURCC_XVID && inhdr->biCompression != FOURCC_DIVX && inhdr->biCompression != FOURCC_DX50 && get_colorspace(inhdr) == XVID_CSP_NULL)          if (inhdr->biCompression != FOURCC_XVID && inhdr->biCompression != FOURCC_DIVX && inhdr->biCompression != FOURCC_DX50 && inhdr->biCompression != FOURCC_MP4V &&
940                    inhdr->biCompression != FOURCC_xvid && inhdr->biCompression != FOURCC_divx && inhdr->biCompression != FOURCC_dx50 && inhdr->biCompression != FOURCC_mp4v &&
941                    (in_csp = get_colorspace(inhdr)) != XVID_CSP_YV12)
942          {          {
943                  return ICERR_BADFORMAT;                  return ICERR_BADFORMAT;
944          }          }
# Line 935  Line 948 
948                  return ICERR_OK;                  return ICERR_OK;
949          }          }
950    
951            out_csp = get_colorspace(outhdr);
952    
953          if (inhdr->biWidth != outhdr->biWidth ||          if (inhdr->biWidth != outhdr->biWidth ||
954                  inhdr->biHeight != outhdr->biHeight ||                  inhdr->biHeight != outhdr->biHeight ||
955                  get_colorspace(outhdr) == XVID_CSP_NULL)                  out_csp == XVID_CSP_NULL ||
956                    (in_csp == XVID_CSP_YV12 && in_csp != out_csp))
957          {          {
958                  return ICERR_BADFORMAT;                  return ICERR_BADFORMAT;
959          }          }
# Line 1080  Line 1096 
1096          /* --- yv12 --- */          /* --- yv12 --- */
1097          if (icd->lpbiInput->biCompression != FOURCC_XVID &&          if (icd->lpbiInput->biCompression != FOURCC_XVID &&
1098                   icd->lpbiInput->biCompression != FOURCC_DIVX &&                   icd->lpbiInput->biCompression != FOURCC_DIVX &&
1099                   icd->lpbiInput->biCompression != FOURCC_DX50)                   icd->lpbiInput->biCompression != FOURCC_DX50 &&
1100                     icd->lpbiInput->biCompression != FOURCC_MP4V &&
1101                     icd->lpbiInput->biCompression != FOURCC_xvid &&
1102                     icd->lpbiInput->biCompression != FOURCC_divx &&
1103                     icd->lpbiInput->biCompression != FOURCC_dx50 &&
1104                     icd->lpbiInput->biCompression != FOURCC_mp4v)
1105          {          {
1106                  xvid_gbl_convert_t convert;                  xvid_gbl_convert_t convert;
1107    

Legend:
Removed from v.1933  
changed lines
  Added in v.2020

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