History

Introducing video_stype for holding the value of VAUX source pack and simplifying dv_frame_profile

Originally committed as revision 15007 to svn://svn.ffmpeg.org/ffmpeg/trunk

Roman Shaposhnik committed 18 years ago

Commit b4e01021 parent 452d3ed1 file · +22 −16Browse files

Unified · Split

libavcodec/dvdata.h+22−16
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 */
3939 typedef struct DVprofile {
4040 int dsf; /* value of the dsf in the DV header */
41+ int video_stype; /* stype for VAUX source pack */
4142 int frame_size; /* total size of one frame in bytes */
4243 int difseg_size; /* number of DIF segments per DIF channel */
4344 int n_difchan; /* number of DIF channels per frame */
@@ -2533,6 +2534,7 @@ static const uint8_t block_sizes_dv100[8] = { · 2489 unmodified lines
25332534
25342535 static const DVprofile dv_profiles[] = {
25352536 { .dsf = 0,
2537+ .video_stype = 0x0,
25362538 .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
25372539 .difseg_size = 10,
25382540 .n_difchan = 1,
@@ -2552,6 +2554,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
25522554 .audio_shuffle = dv_audio_shuffle525,
25532555 },
25542556 { .dsf = 1,
2557+ .video_stype = 0x0,
25552558 .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */
25562559 .difseg_size = 12,
25572560 .n_difchan = 1,
@@ -2571,6 +2574,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
25712574 .audio_shuffle = dv_audio_shuffle625,
25722575 },
25732576 { .dsf = 1,
2577+ .video_stype = 0x0,
25742578 .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */
25752579 .difseg_size = 12,
25762580 .n_difchan = 1,
@@ -2590,6 +2594,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
25902594 .audio_shuffle = dv_audio_shuffle625,
25912595 },
25922596 { .dsf = 0,
2597+ .video_stype = 0x4,
25932598 .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */
25942599 .difseg_size = 10, /* also known as "DVCPRO50" */
25952600 .n_difchan = 2,
@@ -2609,6 +2614,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
26092614 .audio_shuffle = dv_audio_shuffle525,
26102615 },
26112616 { .dsf = 1,
2617+ .video_stype = 0x4,
26122618 .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */
26132619 .difseg_size = 12, /* also known as "DVCPRO50" */
26142620 .n_difchan = 2,
@@ -2663,22 +2669,22 @@ enum dv_pack_type { · 48 unmodified lines
26632669
26642670 static inline const DVprofile* dv_frame_profile(const uint8_t* frame)
26652671 {
2666− if ((frame[3] & 0x80) == 0) { /* DSF flag */
2667− /* it's an NTSC format */
2668− if ((frame[80*5 + 48 + 3] & 0x4) && (frame[80*5 + 48] == dv_video_source)) { /* 4:2:2 sampling */
2669− return &dv_profiles[3]; /* NTSC 50Mbps */
2670− } else { /* 4:1:1 sampling */
2671− return &dv_profiles[0]; /* NTSC 25Mbps */
2672− }
2673− } else {
2674− /* it's a PAL format */
2675− if ((frame[80*5 + 48 + 3] & 0x4) && (frame[80*5 + 48] == dv_video_source)) { /* 4:2:2 sampling */
2676− return &dv_profiles[4]; /* PAL 50Mbps */
2677− } else if ((frame[5] & 0x07) == 0) { /* APT flag */
2678− return &dv_profiles[1]; /* PAL 25Mbps 4:2:0 */
2679− } else
2680− return &dv_profiles[2]; /* PAL 25Mbps 4:1:1 */
2681− }
2672+ int i;
2673+
2674+ int dsf = (frame[3] & 0x80) >> 7;
2675+
2676+ int stype = frame[80*5 + 48 + 3] & 0x1f;
2677+
2678+ /* 576i50 25Mbps 4:1:1 is a special case */
2679+ if (dsf == 1 && stype == 0 && frame[5] & 0x07) {
2680+ return &dv_profiles[2];
2681+ }
2682+
2683+ for (i=0; i<sizeof(dv_profiles)/sizeof(DVprofile); i++)
2684+ if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
2685+ return &dv_profiles[i];
2686+
2687+ return NULL;
26822688 }
26832689
26842690 static inline const DVprofile* dv_codec_profile(AVCodecContext* codec)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t