Changeset 876
- Timestamp:
- 05/08/08 15:33:27 (7 months ago)
- Files:
-
- trunk/ColorConversions.c (modified) (1 diff)
- trunk/ColorConversions.h (modified) (1 diff)
- trunk/FFusionCodec.c (modified) (5 diffs)
- trunk/FFusionCodec.h (modified) (1 diff)
- trunk/FFusionCodec.r (modified) (9 diffs)
- trunk/ff_MovieImport.c (modified) (1 diff)
- trunk/ff_private.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ColorConversions.c
r868 r876 341 341 #endif 342 342 343 void YA420toV408(UInt8* o, unsigned outRB, unsigned width, unsigned height, AVFrame * picture) 344 { 345 UInt8 *yc = picture->data[0], *u = picture->data[1], *v = picture->data[2], *a = picture->data[3]; 346 unsigned rY = picture->linesize[0], rU = picture->linesize[1], rV = picture->linesize[2], rA = picture->linesize[3], y, x; 347 348 for (y = 0; y < height; y++) { 349 for (x = 0; x < width; x++) { 350 o[x*4] = u[x/2]; 351 o[x*4+1] = yc[x]; 352 o[x*4+2] = v[x/2]; 353 o[x*4+3] = a[x]; 354 } 355 356 o += outRB; 357 yc += rY; 358 a += rA; 359 if (y & 1) { 360 u += rU; 361 v += rV; 362 } 363 } 364 } 365 343 366 void BGR24toRGB24(UInt8 *baseAddr, unsigned rowBytes, unsigned width, unsigned height, AVFrame *picture) 344 367 { trunk/ColorConversions.h
r868 r876 23 23 extern void FastY420(UInt8 *baseAddr, AVFrame *picture); 24 24 extern void Y420toY422(UInt8* baseAddr, unsigned rowBytes, unsigned width, unsigned height, AVFrame * picture); 25 extern void YA420toV408(UInt8* o, unsigned outRB, unsigned width, unsigned height, AVFrame * picture); 25 26 extern void RGB32toRGB32(UInt8 *baseAddr, unsigned rowBytes, unsigned width, unsigned height, AVFrame *picture); 26 27 extern void RGB24toRGB24(UInt8 *baseAddr, unsigned rowBytes, unsigned width, unsigned height, AVFrame *picture); trunk/FFusionCodec.c
r869 r876 676 676 codecID = CODEC_ID_ZMBV; 677 677 break; 678 678 679 case 'VP6A': 680 codecID = CODEC_ID_VP6A; 681 break; 679 682 680 683 default: … … 830 833 case PIX_FMT_RGB24: 831 834 pos[index++] = k24RGBPixelFormat; 835 break; 836 case PIX_FMT_YUVA420P: 837 pos[index++] = k4444YpCbCrA8PixelFormat; 832 838 break; 833 839 case PIX_FMT_YUV420P: … … 1316 1322 Y422toY422((UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height, picture); 1317 1323 } 1324 else if (myDrp->pixelFormat == k4444YpCbCrA8PixelFormat && glob->avContext->pix_fmt == PIX_FMT_YUVA420P) 1325 { 1326 YA420toV408((UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height, picture); 1327 } 1318 1328 else 1319 1329 { … … 1592 1602 break; 1593 1603 1604 case 'VP6A': 1605 err = GetComponentResource((Component)glob->self, codecInfoResourceType, kVP6ACodecInfoResID, (Handle *)&tempCodecInfo); 1606 break; 1594 1607 1595 1608 default: // should never happen but we have to handle the case … … 1679 1692 got_picture = 0; 1680 1693 len = 1; 1681 Codecprintf( NULL, "Error while decoding frame\n");1694 Codecprintf(glob->fileLog, "Error while decoding frame\n"); 1682 1695 1683 1696 return noErr; trunk/FFusionCodec.h
r869 r876 53 53 #define kTSCCCodecInfoResID 305 54 54 #define kZMBVCodecInfoResID 307 55 #define kVP6ACodecInfoResID 309 55 56 56 57 #define kFFusionCodecManufacturer 'Peri' trunk/FFusionCodec.r
r869 r876 55 55 #define kFLV1Name "Sorenson H.263" 56 56 #define kFlashSVName "Flash Screen Video" 57 #define kVP6Name "TrueMotion VP6" 57 #define kVP6Name "On2 VP6" 58 #define kVP6AName "On2 VP6+Alpha" 58 59 #define kI263Name "Intel H.263" 59 60 #define kVP3Name "On2 VP3" … … 91 92 #define kTSCCNameResID 305 92 93 #define kZMBVNameResID 307 94 #define kVP6ANameResID 309 93 95 94 96 // Codec infos Resource ID … … 116 118 #define kTSCCInfoResID 306 117 119 #define kZMBVInfoResID 308 120 #define kVP6AInfoResID 310 118 121 119 122 // These flags specify information about the capabilities of the component … … 679 682 }; 680 683 684 //--------------------------------------------------------------------------- 685 // ZMBV Description Resources 686 //--------------------------------------------------------------------------- 687 688 resource 'cdci' (kVP6ACodecInfoResID) { 689 kVP6AName, // Type 690 1, // Version 691 1, // Revision level 692 kFFusionCodecManufacturer, // Manufacturer 693 kFFusionDecompressionFlags, // Decompression Flags 694 0, // Compression Flags 695 kFFusionFormatFlags, // Format Flags 696 128, // Compression Accuracy 697 128, // Decomression Accuracy 698 200, // Compression Speed 699 200, // Decompression Speed 700 128, // Compression Level 701 0, // Reserved 702 1, // Minimum Height 703 1, // Minimum Width 704 0, // Decompression Pipeline Latency 705 0, // Compression Pipeline Latency 706 0 // Private Data 707 }; 681 708 682 709 //--------------------------------------------------------------------------- … … 3191 3218 // ZMBV Components 3192 3219 //--------------------------------------------------------------------------- 3220 resource 'thng' (338) { 3221 decompressorComponentType, // Type 3222 'VP6A', // SubType 3223 kFFusionCodecManufacturer, // Manufacturer 3224 0, // - use componentHasMultiplePlatforms 3225 0, 3226 0, 3227 0, 3228 'STR ', // Name Type 3229 kVP6ANameResID, // Name ID 3230 'STR ', // Info Type 3231 kVP6AInfoResID, // Info ID 3232 0, // Icon Type 3233 0, // Icon ID 3234 kFFusionCodecVersion, // Version 3235 componentHasMultiplePlatforms + // Registration Flags 3236 componentDoAutoVersion, // Registration Flags 3237 0, // Resource ID of Icon Family 3238 { 3239 kFFusionDecompressionFlags, 3240 'dlle', // Entry point found by symbol name 'dlle' resource 3241 256, // ID of 'dlle' resource 3242 platformPowerPCNativeEntryPoint, 3243 kFFusionDecompressionFlags, 3244 'dlle', 3245 256, 3246 platformIA32NativeEntryPoint, 3247 }; 3248 }; 3249 3250 //--------------------------------------------------------------------------- 3251 // ZMBV Components 3252 //--------------------------------------------------------------------------- 3193 3253 resource 'thng' (337) { 3194 3254 decompressorComponentType, // Type … … 3221 3281 }; 3222 3282 3223 3224 3283 //--------------------------------------------------------------------------- 3225 3284 // Component Name Resources … … 3314 3373 }; 3315 3374 3375 resource 'STR ' (kVP6ANameResID) { 3376 "On2 VP6A (Perian)" 3377 }; 3378 3316 3379 //--------------------------------------------------------------------------- 3317 3380 // Component Name Resources … … 3363 3426 3364 3427 resource 'STR ' (kVP6InfoResID) { 3365 "Decompresses video stored in TrueMotionVP6 format."3428 "Decompresses video stored in On2 VP6 format." 3366 3429 }; 3367 3430 … … 3406 3469 }; 3407 3470 3471 resource 'STR ' (kVP6AInfoResID) { 3472 "Decompresses video stored in On2 VP6A format." 3473 }; 3474 3408 3475 //--------------------------------------------------------------------------- 3409 3476 // Code Entry Point for Mach-O trunk/ff_MovieImport.c
r832 r876 121 121 REGISTER_DECODER(dvdsub); 122 122 REGISTER_DECODER(tscc); 123 REGISTER_DECODER(vp6a); 124 REGISTER_DECODER(zmbv); 123 125 124 126 av_log_set_callback(FFMpegCodecprintf); trunk/ff_private.c
r857 r876 122 122 av_reduce(&base->num, &base->den, base->num, base->den, INT_MAX); 123 123 124 if (base->num == 1) return; // XXX is this good enough? 125 124 126 double fTimebase = av_q2d(*base), nearest_ntsc = floor(fTimebase * 1001. + .5) / 1001.; 125 127 const double small_interval = 1./120.; … … 185 187 // 12 is invalid in mov 186 188 // XXX it might be better to set this based entirely on pix_fmt 187 if ((*imgHdl)->depth == 12 ) (*imgHdl)->depth =24;189 if ((*imgHdl)->depth == 12 || (*imgHdl)->depth == 0) (*imgHdl)->depth = codec->pix_fmt == PIX_FMT_YUVA420P ? 32 : 24; 188 190 189 191 /* Create the strf image description extension (see AVI's BITMAPINFOHEADER) */ … … 326 328 case CODEC_ID_FLASHSV: 327 329 return 'FSV1'; 330 case CODEC_ID_VP6A: 331 return 'VP6A'; 328 332 } 329 333 return 0;
