MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / dv_extract_pack

Function dv_extract_pack

libavformat/dv.c:99–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99static const uint8_t *dv_extract_pack(const uint8_t *frame, enum DVPackType t)
100{
101 int offs;
102 int c;
103
104 for (c = 0; c < 10; c++) {
105 switch (t) {
106 case DV_AUDIO_SOURCE:
107 if (c&1) offs = (80 * 6 + 80 * 16 * 0 + 3 + c*12000);
108 else offs = (80 * 6 + 80 * 16 * 3 + 3 + c*12000);
109 break;
110 case DV_AUDIO_CONTROL:
111 if (c&1) offs = (80 * 6 + 80 * 16 * 1 + 3 + c*12000);
112 else offs = (80 * 6 + 80 * 16 * 4 + 3 + c*12000);
113 break;
114 case DV_VIDEO_CONTROL:
115 if (c&1) offs = (80 * 3 + 8 + c*12000);
116 else offs = (80 * 5 + 48 + 5 + c*12000);
117 break;
118 case DV_TIMECODE:
119 offs = (80*1 + 3 + 3);
120 break;
121 default:
122 return NULL;
123 }
124 if (frame[offs] == t)
125 break;
126 }
127
128 return frame[offs] == t ? &frame[offs] : NULL;
129}
130
131static const int dv_audio_frequency[3] = {
132 48000, 44100, 32000,

Callers 4

dv_extract_audioFunction · 0.85
dv_extract_audio_infoFunction · 0.85
dv_extract_video_infoFunction · 0.85
dv_extract_timecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected