[svn] / branches / dev-api-3 / vfw / src / codec.c Repository:
ViewVC logotype

Diff of /branches/dev-api-3/vfw/src/codec.c

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

revision 625, Sun Nov 3 03:22:03 2002 UTC revision 634, Fri Nov 8 10:11:48 2002 UTC
# Line 172  Line 172 
172          }          }
173    
174          if (inhdr->biWidth != outhdr->biWidth || inhdr->biHeight != outhdr->biHeight ||          if (inhdr->biWidth != outhdr->biWidth || inhdr->biHeight != outhdr->biHeight ||
175                  (outhdr->biCompression != FOURCC_XVID && outhdr->biCompression != FOURCC_DIVX))                  (outhdr->biCompression != FOURCC_XVID && outhdr->biCompression != FOURCC_DIVX && outhdr->biCompression != FOURCC_DX50))
176          {          {
177                  return ICERR_BADFORMAT;                  return ICERR_BADFORMAT;
178          }          }
# Line 401  Line 401 
401                  frame.general |= XVID_INTERLACING;                  frame.general |= XVID_INTERLACING;
402    
403    
404    
405  // added by koepi for credits greyscale  // added by koepi for credits greyscale
406    
407          check_greyscale_mode(&codec->config, &frame, codec->framenum);          check_greyscale_mode(&codec->config, &frame, codec->framenum);
# Line 450  Line 451 
451          frame.motion = pmvfast_presets[codec->config.motion_search];          frame.motion = pmvfast_presets[codec->config.motion_search];
452    
453          frame.image = icc->lpInput;          frame.image = icc->lpInput;
454          // dev-api-3 frame.stride = (((icc->lpbiInput->biWidth * icc->lpbiInput->biBitCount) + 31) & ~31) >> 3;          // dev-api-3
455            frame.stride = (((icc->lpbiInput->biWidth * icc->lpbiInput->biBitCount) + 31) & ~31) >> 3;
456    
457          if ((frame.colorspace = get_colorspace(inhdr)) == XVID_CSP_NULL)          if ((frame.colorspace = get_colorspace(inhdr)) == XVID_CSP_NULL)
458                  return ICERR_BADFORMAT;                  return ICERR_BADFORMAT;
# Line 608  Line 610 
610          {          {
611                  return ICERR_ERROR;                  return ICERR_ERROR;
612          }          }
 /* --- yv12 --- */  
         if (inhdr->biCompression == FOURCC_YV12) {  
                 return ICERR_OK;  
         }  
 /* --- yv12 --- */  
613    
614          if (inhdr->biCompression != FOURCC_XVID && inhdr->biCompression != FOURCC_DIVX)          if (inhdr->biCompression != FOURCC_XVID &&
615                    inhdr->biCompression != FOURCC_DIVX &&
616                    inhdr->biCompression != FOURCC_DX50 &&
617                    get_colorspace(inhdr) == XVID_CSP_NULL)
618          {          {
619                  return ICERR_BADFORMAT;                  return ICERR_BADFORMAT;
620          }          }
# Line 647  Line 647 
647          }          }
648    
649          /* --- yv12 --- */          /* --- yv12 --- */
650            if (get_colorspace(inhdr) != XVID_CSP_NULL) {
         if (lpbiInput->bmiHeader.biCompression == FOURCC_YV12) {  
651                  memcpy(outhdr, inhdr, sizeof(BITMAPINFOHEADER));                  memcpy(outhdr, inhdr, sizeof(BITMAPINFOHEADER));
652                    // XXX: should we set outhdr->biSize ??
653                  return ICERR_OK;                  return ICERR_OK;
654          }          }
655          /* --- yv12 --- */          /* --- yv12 --- */
# Line 725  Line 725 
725          frame.length = icd->lpbiInput->biSizeImage;          frame.length = icd->lpbiInput->biSizeImage;
726    
727          frame.image = icd->lpOutput;          frame.image = icd->lpOutput;
728          frame.stride = icd->lpbiOutput->biWidth;          //frame.stride = icd->lpbiOutput->biWidth;
729          // dev-api-3: frame.stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3;          // dev-api-3:
730            frame.stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3;
731    
732          /* --- yv12 --- */          /* --- yv12 --- */
733          if (icd->lpbiInput->biCompression == FOURCC_YV12) {          if (icd->lpbiInput->biCompression != FOURCC_XVID &&
734                    icd->lpbiInput->biCompression != FOURCC_DIVX &&
735                    icd->lpbiInput->biCompression != FOURCC_DX50)
736            {
737                    XVID_INIT_CONVERTINFO convert;
738    
739                    DEBUGFOURCC("input", icd->lpbiInput->biCompression);
740                  DEBUGFOURCC("output", icd->lpbiOutput->biCompression);                  DEBUGFOURCC("output", icd->lpbiOutput->biCompression);
741                  if (icd->lpbiOutput->biCompression == FOURCC_YV12) {  
742                          memcpy(frame.image,codec->dhandle,icd->lpbiInput->biSizeImage);                  convert.input.colorspace = get_colorspace(icd->lpbiInput);
743                    convert.input.y = icd->lpInput;
744                    convert.input.y_stride = (((icd->lpbiInput->biWidth * icd->lpbiInput->biBitCount) + 31) & ~31) >> 3;
745    
746                    convert.output.colorspace = get_colorspace(icd->lpbiOutput);
747                    convert.output.y = icd->lpOutput;
748                    convert.output.y_stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3;
749    
750                    convert.width = icd->lpbiInput->biWidth;
751                    convert.height = icd->lpbiInput->biHeight;
752                    convert.interlacing = 0;
753    
754                    if (convert.input.colorspace == XVID_CSP_NULL ||
755                            convert.output.colorspace == XVID_CSP_NULL ||
756                            xvid_init(NULL, XVID_INIT_CONVERT, &convert, NULL) != XVID_ERR_OK)
757                    {
758                            return ICERR_BADFORMAT;
759                  }                  }
760    
761                  return ICERR_OK;                  return ICERR_OK;
762          }          }
763          /* --- yv12 --- */          /* --- yv12 --- */

Legend:
Removed from v.625  
changed lines
  Added in v.634

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