Originally committed as revision 15007 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -38,6 +38,7 @@ · 37 unmodified lines | |||
| 38 | */ | 38 | */ |
| 39 | typedef struct DVprofile { | 39 | typedef struct DVprofile { |
| 40 | int dsf; /* value of the dsf in the DV header */ | 40 | int dsf; /* value of the dsf in the DV header */ |
| 41 | int video_stype; /* stype for VAUX source pack */ | ||
| 41 | int frame_size; /* total size of one frame in bytes */ | 42 | int frame_size; /* total size of one frame in bytes */ |
| 42 | int difseg_size; /* number of DIF segments per DIF channel */ | 43 | int difseg_size; /* number of DIF segments per DIF channel */ |
| 43 | int n_difchan; /* number of DIF channels per frame */ | 44 | int n_difchan; /* number of DIF channels per frame */ |
| @@ -2533,6 +2534,7 @@ static const uint8_t block_sizes_dv100[8] = { · 2489 unmodified lines | |||
| 2533 | 2534 | ||
| 2534 | static const DVprofile dv_profiles[] = { | 2535 | static const DVprofile dv_profiles[] = { |
| 2535 | { .dsf = 0, | 2536 | { .dsf = 0, |
| 2537 | .video_stype = 0x0, | ||
| 2536 | .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */ | 2538 | .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */ |
| 2537 | .difseg_size = 10, | 2539 | .difseg_size = 10, |
| 2538 | .n_difchan = 1, | 2540 | .n_difchan = 1, |
| @@ -2552,6 +2554,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines | |||
| 2552 | .audio_shuffle = dv_audio_shuffle525, | 2554 | .audio_shuffle = dv_audio_shuffle525, |
| 2553 | }, | 2555 | }, |
| 2554 | { .dsf = 1, | 2556 | { .dsf = 1, |
| 2557 | .video_stype = 0x0, | ||
| 2555 | .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */ | 2558 | .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */ |
| 2556 | .difseg_size = 12, | 2559 | .difseg_size = 12, |
| 2557 | .n_difchan = 1, | 2560 | .n_difchan = 1, |
| @@ -2571,6 +2574,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines | |||
| 2571 | .audio_shuffle = dv_audio_shuffle625, | 2574 | .audio_shuffle = dv_audio_shuffle625, |
| 2572 | }, | 2575 | }, |
| 2573 | { .dsf = 1, | 2576 | { .dsf = 1, |
| 2577 | .video_stype = 0x0, | ||
| 2574 | .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */ | 2578 | .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */ |
| 2575 | .difseg_size = 12, | 2579 | .difseg_size = 12, |
| 2576 | .n_difchan = 1, | 2580 | .n_difchan = 1, |
| @@ -2590,6 +2594,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines | |||
| 2590 | .audio_shuffle = dv_audio_shuffle625, | 2594 | .audio_shuffle = dv_audio_shuffle625, |
| 2591 | }, | 2595 | }, |
| 2592 | { .dsf = 0, | 2596 | { .dsf = 0, |
| 2597 | .video_stype = 0x4, | ||
| 2593 | .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */ | 2598 | .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */ |
| 2594 | .difseg_size = 10, /* also known as "DVCPRO50" */ | 2599 | .difseg_size = 10, /* also known as "DVCPRO50" */ |
| 2595 | .n_difchan = 2, | 2600 | .n_difchan = 2, |
| @@ -2609,6 +2614,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines | |||
| 2609 | .audio_shuffle = dv_audio_shuffle525, | 2614 | .audio_shuffle = dv_audio_shuffle525, |
| 2610 | }, | 2615 | }, |
| 2611 | { .dsf = 1, | 2616 | { .dsf = 1, |
| 2617 | .video_stype = 0x4, | ||
| 2612 | .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */ | 2618 | .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */ |
| 2613 | .difseg_size = 12, /* also known as "DVCPRO50" */ | 2619 | .difseg_size = 12, /* also known as "DVCPRO50" */ |
| 2614 | .n_difchan = 2, | 2620 | .n_difchan = 2, |
| @@ -2663,22 +2669,22 @@ enum dv_pack_type { · 48 unmodified lines | |||
| 2663 | 2669 | ||
| 2664 | static inline const DVprofile* dv_frame_profile(const uint8_t* frame) | 2670 | static inline const DVprofile* dv_frame_profile(const uint8_t* frame) |
| 2665 | { | 2671 | { |
| 2666 | if ((frame[3] & 0x80) == 0) { /* DSF flag */ | 2672 | int i; |
| 2667 | /* it's an NTSC format */ | 2673 | |
| 2668 | if ((frame[80*5 + 48 + 3] & 0x4) && (frame[80*5 + 48] == dv_video_source)) { /* 4:2:2 sampling */ | 2674 | int dsf = (frame[3] & 0x80) >> 7; |
| 2669 | return &dv_profiles[3]; /* NTSC 50Mbps */ | 2675 | |
| 2670 | } else { /* 4:1:1 sampling */ | 2676 | int stype = frame[80*5 + 48 + 3] & 0x1f; |
| 2671 | return &dv_profiles[0]; /* NTSC 25Mbps */ | 2677 | |
| 2672 | } | 2678 | /* 576i50 25Mbps 4:1:1 is a special case */ |
| 2673 | } else { | 2679 | if (dsf == 1 && stype == 0 && frame[5] & 0x07) { |
| 2674 | /* it's a PAL format */ | 2680 | return &dv_profiles[2]; |
| 2675 | if ((frame[80*5 + 48 + 3] & 0x4) && (frame[80*5 + 48] == dv_video_source)) { /* 4:2:2 sampling */ | 2681 | } |
| 2676 | return &dv_profiles[4]; /* PAL 50Mbps */ | 2682 | |
| 2677 | } else if ((frame[5] & 0x07) == 0) { /* APT flag */ | 2683 | for (i=0; i<sizeof(dv_profiles)/sizeof(DVprofile); i++) |
| 2678 | return &dv_profiles[1]; /* PAL 25Mbps 4:2:0 */ | 2684 | if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype) |
| 2679 | } else | 2685 | return &dv_profiles[i]; |
| 2680 | return &dv_profiles[2]; /* PAL 25Mbps 4:1:1 */ | 2686 | |
| 2681 | } | 2687 | return NULL; |
| 2682 | } | 2688 | } |
| 2683 | 2689 | ||
| 2684 | static inline const DVprofile* dv_codec_profile(AVCodecContext* codec) | 2690 | static inline const DVprofile* dv_codec_profile(AVCodecContext* codec) |