annotate dvdata.h @ 12475:9fef0a8ddd63 libavcodec

Move mm_support() from libavcodec to libavutil, make it a public function and rename it to av_get_cpu_flags().
author stefano
date Wed, 08 Sep 2010 15:07:14 +0000
parents 7dd2a45249a9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
1 /*
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
2 * Constants for DV codec
8629
04423b2f6e0b cosmetics: Remove pointless period after copyright statement non-sentences.
diego
parents: 8175
diff changeset
3 * Copyright (c) 2002 Fabrice Bellard
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
4 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3671
diff changeset
5 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3671
diff changeset
6 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3671
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3671
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
11 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3671
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
15 * Lesser General Public License for more details.
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
16 *
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3671
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
3036
0b546eab515d Update licensing information: The FSF changed postal address.
diego
parents: 2967
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
20 */
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
21
1106
1e39f273ecd6 per file doxy
michaelni
parents: 1087
diff changeset
22 /**
11644
7dd2a45249a9 Remove explicit filename from Doxygen @file commands.
diego
parents: 11521
diff changeset
23 * @file
1106
1e39f273ecd6 per file doxy
michaelni
parents: 1087
diff changeset
24 * Constants for DV codec.
1e39f273ecd6 per file doxy
michaelni
parents: 1087
diff changeset
25 */
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
26
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7715
diff changeset
27 #ifndef AVCODEC_DVDATA_H
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7715
diff changeset
28 #define AVCODEC_DVDATA_H
5163
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 5162
diff changeset
29
6763
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 6266
diff changeset
30 #include "libavutil/rational.h"
5162
4394344397d8 include all prerequisites in header files
mru
parents: 5083
diff changeset
31 #include "avcodec.h"
4394344397d8 include all prerequisites in header files
mru
parents: 5083
diff changeset
32
8131
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
33 typedef struct DVwork_chunk {
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
34 uint16_t buf_offset;
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
35 uint16_t mb_coordinates[5];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
36 } DVwork_chunk;
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
37
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
38 /*
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
39 * DVprofile is used to express the differences between various
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
40 * DV flavors. For now it's primarily used for differentiating
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
41 * 525/60 and 625/50, but the plans are to use it for various
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
42 * DV specs as well (e.g. SMPTE314M vs. IEC 61834).
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
43 */
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
44 typedef struct DVprofile {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
45 int dsf; /* value of the dsf in the DV header */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
46 int video_stype; /* stype for VAUX source pack */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
47 int frame_size; /* total size of one frame in bytes */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
48 int difseg_size; /* number of DIF segments per DIF channel */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
49 int n_difchan; /* number of DIF channels per frame */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
50 AVRational time_base; /* 1/framerate */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
51 int ltc_divisor; /* FPS from the LTS standpoint */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
52 int height; /* picture height in pixels */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
53 int width; /* picture width in pixels */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
54 AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */
8131
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
55 DVwork_chunk *work_chunks; /* each thread gets its own chunk of frame to work on */
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
56 uint32_t *idct_factor; /* set of iDCT factor tables */
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
57 enum PixelFormat pix_fmt; /* picture pixel format */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
58 int bpm; /* blocks per macroblock */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
59 const uint8_t *block_sizes; /* AC block sizes, in bits */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
60 int audio_stride; /* size of audio_shuffle table */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
61 int audio_min_samples[3]; /* min amount of audio samples */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
62 /* for 48kHz, 44.1kHz and 32kHz */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
63 int audio_samples_dist[5]; /* how many samples are supposed to be */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
64 /* in each frame in a 5 frames window */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
65 const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
66 } DVprofile;
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
67
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
68 /* unquant tables (not used directly) */
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
69 static const uint8_t dv_quant_shifts[22][4] = {
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
70 { 3,3,4,4 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
71 { 3,3,4,4 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
72 { 2,3,3,4 },
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
73 { 2,3,3,4 },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
74 { 2,2,3,3 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
75 { 2,2,3,3 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
76 { 1,2,2,3 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
77 { 1,2,2,3 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
78 { 1,1,2,2 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
79 { 1,1,2,2 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
80 { 0,1,1,2 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
81 { 0,1,1,2 },
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
82 { 0,0,1,1 },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
83 { 0,0,1,1 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
84 { 0,0,0,1 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
85 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
86 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
87 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
88 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
89 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
90 { 0,0,0,0 },
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
91 { 0,0,0,0 },
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
92 };
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
93
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
94 static const uint8_t dv_quant_offset[4] = { 6, 3, 0, 1 };
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
95 static const uint8_t dv_quant_areas[4] = { 6, 21, 43, 64 };
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
96
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
97 /* quantization quanta by QNO for DV100 */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
98 static const uint8_t dv100_qstep[16] = {
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
99 1, /* QNO = 0 and 1 both have no quantization */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
100 1,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
101 2, 3, 4, 5, 6, 7, 8, 16, 18, 20, 22, 24, 28, 52
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
102 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
103
3149
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
104 /* DV25/50 DCT coefficient weights and inverse weights */
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
105 /* created by dvtables.py */
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
106 static const int dv_weight_bits = 18;
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
107 static const int dv_weight_88[64] = {
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
108 131072, 257107, 257107, 242189, 252167, 242189, 235923, 237536,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
109 237536, 235923, 229376, 231390, 223754, 231390, 229376, 222935,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
110 224969, 217965, 217965, 224969, 222935, 200636, 218652, 211916,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
111 212325, 211916, 218652, 200636, 188995, 196781, 205965, 206433,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
112 206433, 205965, 196781, 188995, 185364, 185364, 200636, 200704,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
113 200636, 185364, 185364, 174609, 180568, 195068, 195068, 180568,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
114 174609, 170091, 175557, 189591, 175557, 170091, 165371, 170627,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
115 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
116 };
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
117 static const int dv_weight_248[64] = {
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
118 131072, 242189, 257107, 237536, 229376, 200636, 242189, 223754,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
119 224969, 196781, 262144, 242189, 229376, 200636, 257107, 237536,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
120 211916, 185364, 235923, 217965, 229376, 211916, 206433, 180568,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
121 242189, 223754, 224969, 196781, 211916, 185364, 235923, 217965,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
122 200704, 175557, 222935, 205965, 200636, 185364, 195068, 170627,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
123 229376, 211916, 206433, 180568, 200704, 175557, 222935, 205965,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
124 175557, 153560, 188995, 174609, 165371, 144651, 200636, 185364,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
125 195068, 170627, 175557, 153560, 188995, 174609, 165371, 144651,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
126 };
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
127 static const int dv_iweight_bits = 14;
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
128 static const int dv_iweight_88[64] = {
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
129 32768, 16710, 16710, 17735, 17015, 17735, 18197, 18079,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
130 18079, 18197, 18725, 18559, 19196, 18559, 18725, 19284,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
131 19108, 19692, 19692, 19108, 19284, 21400, 19645, 20262,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
132 20214, 20262, 19645, 21400, 22733, 21845, 20867, 20815,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
133 20815, 20867, 21845, 22733, 23173, 23173, 21400, 21400,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
134 21400, 23173, 23173, 24600, 23764, 22017, 22017, 23764,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
135 24600, 25267, 24457, 22672, 24457, 25267, 25971, 25191,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
136 25191, 25971, 26715, 27962, 26715, 29642, 29642, 31536,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
137 };
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
138 static const int dv_iweight_248[64] = {
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
139 32768, 17735, 16710, 18079, 18725, 21400, 17735, 19196,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
140 19108, 21845, 16384, 17735, 18725, 21400, 16710, 18079,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
141 20262, 23173, 18197, 19692, 18725, 20262, 20815, 23764,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
142 17735, 19196, 19108, 21845, 20262, 23173, 18197, 19692,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
143 21400, 24457, 19284, 20867, 21400, 23173, 22017, 25191,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
144 18725, 20262, 20815, 23764, 21400, 24457, 19284, 20867,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
145 24457, 27962, 22733, 24600, 25971, 29642, 21400, 23173,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
146 22017, 25191, 24457, 27962, 22733, 24600, 25971, 29642,
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
147 };
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
148
8009
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
149 /**
8050
4eac1822bc65 spelling cosmetics
diego
parents: 8042
diff changeset
150 * The "inverse" DV100 weights are actually just the spec weights (zig-zagged).
8009
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
151 */
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
152 static const int dv_iweight_1080_y[64] = {
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
153 128, 16, 16, 17, 17, 17, 18, 18,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
154 18, 18, 18, 18, 19, 18, 18, 19,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
155 19, 19, 19, 19, 19, 42, 38, 40,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
156 40, 40, 38, 42, 44, 43, 41, 41,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
157 41, 41, 43, 44, 45, 45, 42, 42,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
158 42, 45, 45, 48, 46, 43, 43, 46,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
159 48, 49, 48, 44, 48, 49, 101, 98,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
160 98, 101, 104, 109, 104, 116, 116, 123,
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
161 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
162 static const int dv_iweight_1080_c[64] = {
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
163 128, 16, 16, 17, 17, 17, 25, 25,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
164 25, 25, 26, 25, 26, 25, 26, 26,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
165 26, 27, 27, 26, 26, 42, 38, 40,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
166 40, 40, 38, 42, 44, 43, 41, 41,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
167 41, 41, 43, 44, 91, 91, 84, 84,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
168 84, 91, 91, 96, 93, 86, 86, 93,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
169 96, 197, 191, 177, 191, 197, 203, 197,
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
170 197, 203, 209, 219, 209, 232, 232, 246,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
171 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
172 static const int dv_iweight_720_y[64] = {
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
173 128, 16, 16, 17, 17, 17, 18, 18,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
174 18, 18, 18, 18, 19, 18, 18, 19,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
175 19, 19, 19, 19, 19, 42, 38, 40,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
176 40, 40, 38, 42, 44, 43, 41, 41,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
177 41, 41, 43, 44, 68, 68, 63, 63,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
178 63, 68, 68, 96, 92, 86, 86, 92,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
179 96, 98, 96, 88, 96, 98, 202, 196,
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
180 196, 202, 208, 218, 208, 232, 232, 246,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
181 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
182 static const int dv_iweight_720_c[64] = {
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
183 128, 24, 24, 26, 26, 26, 36, 36,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
184 36, 36, 36, 36, 38, 36, 36, 38,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
185 38, 38, 38, 38, 38, 84, 76, 80,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
186 80, 80, 76, 84, 88, 86, 82, 82,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
187 82, 82, 86, 88, 182, 182, 168, 168,
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
188 168, 182, 182, 192, 186, 192, 172, 186,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
189 192, 394, 382, 354, 382, 394, 406, 394,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
190 394, 406, 418, 438, 418, 464, 464, 492,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
191 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
192
4361
f80a3b6c6f00 uint16->uint8
michael
parents: 3947
diff changeset
193 static const uint8_t dv_audio_shuffle525[10][9] = {
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
194 { 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
195 { 6, 36, 66, 26, 56, 86, 16, 46, 76 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
196 { 12, 42, 72, 2, 32, 62, 22, 52, 82 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
197 { 18, 48, 78, 8, 38, 68, 28, 58, 88 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
198 { 24, 54, 84, 14, 44, 74, 4, 34, 64 },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
199
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
200 { 1, 31, 61, 21, 51, 81, 11, 41, 71 }, /* 2nd channel */
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
201 { 7, 37, 67, 27, 57, 87, 17, 47, 77 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
202 { 13, 43, 73, 3, 33, 63, 23, 53, 83 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
203 { 19, 49, 79, 9, 39, 69, 29, 59, 89 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
204 { 25, 55, 85, 15, 45, 75, 5, 35, 65 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
205 };
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
206
4361
f80a3b6c6f00 uint16->uint8
michael
parents: 3947
diff changeset
207 static const uint8_t dv_audio_shuffle625[12][9] = {
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
208 { 0, 36, 72, 26, 62, 98, 16, 52, 88}, /* 1st channel */
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
209 { 6, 42, 78, 32, 68, 104, 22, 58, 94},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
210 { 12, 48, 84, 2, 38, 74, 28, 64, 100},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
211 { 18, 54, 90, 8, 44, 80, 34, 70, 106},
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
212 { 24, 60, 96, 14, 50, 86, 4, 40, 76},
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
213 { 30, 66, 102, 20, 56, 92, 10, 46, 82},
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
214
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
215 { 1, 37, 73, 27, 63, 99, 17, 53, 89}, /* 2nd channel */
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
216 { 7, 43, 79, 33, 69, 105, 23, 59, 95},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
217 { 13, 49, 85, 3, 39, 75, 29, 65, 101},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
218 { 19, 55, 91, 9, 45, 81, 35, 71, 107},
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
219 { 25, 61, 97, 15, 51, 87, 5, 41, 77},
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
220 { 31, 67, 103, 21, 57, 93, 11, 47, 83},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
221 };
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
222
5083
ce36118abbbb rename attribute_unused to av_unused and moves its declaration to common.h
benoit
parents: 5006
diff changeset
223 static const av_unused int dv_audio_frequency[3] = {
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
224 48000, 44100, 32000,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
225 };
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
226
7616
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
227 /* macroblock bit budgets */
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
228 static const uint8_t block_sizes_dv2550[8] = {
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
229 112, 112, 112, 112, 80, 80, 0, 0,
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
230 };
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
231
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
232 static const uint8_t block_sizes_dv100[8] = {
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
233 80, 80, 80, 80, 80, 80, 64, 64,
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
234 };
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
235
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
236 enum dv_section_type {
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
237 dv_sect_header = 0x1f,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
238 dv_sect_subcode = 0x3f,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
239 dv_sect_vaux = 0x56,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
240 dv_sect_audio = 0x76,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
241 dv_sect_video = 0x96,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
242 };
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
243
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
244 enum dv_pack_type {
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
245 dv_header525 = 0x3f, /* see dv_write_pack for important details on */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
246 dv_header625 = 0xbf, /* these two packs */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
247 dv_timecode = 0x13,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
248 dv_audio_source = 0x50,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
249 dv_audio_control = 0x51,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
250 dv_audio_recdate = 0x52,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
251 dv_audio_rectime = 0x53,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
252 dv_video_source = 0x60,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
253 dv_video_control = 0x61,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
254 dv_video_recdate = 0x62,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
255 dv_video_rectime = 0x63,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
256 dv_unknown_pack = 0xff,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
257 };
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
258
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
259 #define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10)
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
260 #define DV_PROFILE_IS_1080i50(p) (((p)->video_stype == 0x14) && ((p)->dsf == 1))
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
261 #define DV_PROFILE_IS_720p50(p) (((p)->video_stype == 0x18) && ((p)->dsf == 1))
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
262
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
263 /* minimum number of bytes to read from a DV stream in order to
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
264 determine the profile */
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
265 #define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
266
8009
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
267 /**
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
268 * largest possible DV frame, in bytes (1080i50)
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
269 */
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
270 #define DV_MAX_FRAME_SIZE 576000
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
271
8009
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
272 /**
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
273 * maximum number of blocks per macroblock in any DV format
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
274 */
7614
1afa1171b7b2 Introducing DV_MAX_BPM macro instead of a hardcoded value for the
romansh
parents: 7538
diff changeset
275 #define DV_MAX_BPM 8
1afa1171b7b2 Introducing DV_MAX_BPM macro instead of a hardcoded value for the
romansh
parents: 7538
diff changeset
276
10409
3c13cad19e29 Split parts of dvdata.h into dvdata.c, this ensures that things like
reimar
parents: 10265
diff changeset
277 const DVprofile* ff_dv_frame_profile(const DVprofile *sys,
3c13cad19e29 Split parts of dvdata.h into dvdata.c, this ensures that things like
reimar
parents: 10265
diff changeset
278 const uint8_t* frame, unsigned buf_size);
3c13cad19e29 Split parts of dvdata.h into dvdata.c, this ensures that things like
reimar
parents: 10265
diff changeset
279 const DVprofile* ff_dv_codec_profile(AVCodecContext* codec);
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
280
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
281 static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
282 uint8_t seq_num, uint8_t dif_num,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
283 uint8_t* buf)
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
284 {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
285 buf[0] = (uint8_t)t; /* Section type */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
286 buf[1] = (seq_num << 4) | /* DIF seq number 0-9 for 525/60; 0-11 for 625/50 */
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
287 (chan_num << 3) | /* FSC: for 50Mb/s 0 - first channel; 1 - second */
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
288 7; /* reserved -- always 1 */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
289 buf[2] = dif_num; /* DIF block number Video: 0-134, Audio: 0-8 */
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
290 return 3;
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
291 }
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
292
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
293
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
294 static inline int dv_write_ssyb_id(uint8_t syb_num, uint8_t fr, uint8_t* buf)
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
295 {
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
296 if (syb_num == 0 || syb_num == 6) {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
297 buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
298 (0 << 4) | /* AP3 (Subcode application ID) */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
299 0x0f; /* reserved -- always 1 */
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
300 }
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
301 else if (syb_num == 11) {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
302 buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
303 0x7f; /* reserved -- always 1 */
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
304 }
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
305 else {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
306 buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
307 (0 << 4) | /* APT (Track application ID) */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
308 0x0f; /* reserved -- always 1 */
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
309 }
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
310 buf[1] = 0xf0 | /* reserved -- always 1 */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
311 (syb_num & 0x0f); /* SSYB number 0 - 11 */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
312 buf[2] = 0xff; /* reserved -- always 1 */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
313 return 3;
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
314 }
5163
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 5162
diff changeset
315
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7715
diff changeset
316 #endif /* AVCODEC_DVDATA_H */