annotate dvdata.h @ 9487:ab354d259380 libavcodec

Avoid some code duplication in xan_unpack
author reimar
date Fri, 17 Apr 2009 18:54:17 +0000
parents e9d9d946f213
children 756ac43c7fd9
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 /**
8718
e9d9d946f213 Use full internal pathname in doxygen @file directives.
diego
parents: 8713
diff changeset
23 * @file libavcodec/dvdata.h
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 #define NB_DV_VLC 409
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
69
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
70 /*
1631
59f2fa833449 * 3x encoding speedup. Finally we seem to be on par with libdv
romansh
parents: 1590
diff changeset
71 * There's a catch about the following three tables: the mapping they establish
59f2fa833449 * 3x encoding speedup. Finally we seem to be on par with libdv
romansh
parents: 1590
diff changeset
72 * between (run, level) and vlc is not 1-1. So you have to watch out for that
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
73 * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82.
1631
59f2fa833449 * 3x encoding speedup. Finally we seem to be on par with libdv
romansh
parents: 1590
diff changeset
74 */
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1036
diff changeset
75 static const uint16_t dv_vlc_bits[409] = {
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
76 0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
77 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
78 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
79 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
80 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x01e0, 0x01e1, 0x01e2,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
81 0x01e3, 0x01e4, 0x01e5, 0x01e6, 0x01e7, 0x01e8, 0x01e9, 0x01ea,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
82 0x01eb, 0x01ec, 0x01ed, 0x01ee, 0x01ef, 0x03e0, 0x03e1, 0x03e2,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
83 0x03e3, 0x03e4, 0x03e5, 0x03e6, 0x07ce, 0x07cf, 0x07d0, 0x07d1,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
84 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x0fac, 0x0fad, 0x0fae, 0x0faf,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
85 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
86 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0fbd, 0x0fbe, 0x0fbf,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
87 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
88 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
89 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
90 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
91 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
92 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, 0x1fac, 0x1fad, 0x1fae, 0x1faf,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
93 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb5, 0x1fb6, 0x1fb7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
94 0x1fb8, 0x1fb9, 0x1fba, 0x1fbb, 0x1fbc, 0x1fbd, 0x1fbe, 0x1fbf,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
95 0x7f00, 0x7f01, 0x7f02, 0x7f03, 0x7f04, 0x7f05, 0x7f06, 0x7f07,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
96 0x7f08, 0x7f09, 0x7f0a, 0x7f0b, 0x7f0c, 0x7f0d, 0x7f0e, 0x7f0f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
97 0x7f10, 0x7f11, 0x7f12, 0x7f13, 0x7f14, 0x7f15, 0x7f16, 0x7f17,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
98 0x7f18, 0x7f19, 0x7f1a, 0x7f1b, 0x7f1c, 0x7f1d, 0x7f1e, 0x7f1f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
99 0x7f20, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
100 0x7f28, 0x7f29, 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2e, 0x7f2f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
101 0x7f30, 0x7f31, 0x7f32, 0x7f33, 0x7f34, 0x7f35, 0x7f36, 0x7f37,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
102 0x7f38, 0x7f39, 0x7f3a, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, 0x7f3f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
103 0x7f40, 0x7f41, 0x7f42, 0x7f43, 0x7f44, 0x7f45, 0x7f46, 0x7f47,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
104 0x7f48, 0x7f49, 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
105 0x7f50, 0x7f51, 0x7f52, 0x7f53, 0x7f54, 0x7f55, 0x7f56, 0x7f57,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
106 0x7f58, 0x7f59, 0x7f5a, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f5f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
107 0x7f60, 0x7f61, 0x7f62, 0x7f63, 0x7f64, 0x7f65, 0x7f66, 0x7f67,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
108 0x7f68, 0x7f69, 0x7f6a, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6e, 0x7f6f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
109 0x7f70, 0x7f71, 0x7f72, 0x7f73, 0x7f74, 0x7f75, 0x7f76, 0x7f77,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
110 0x7f78, 0x7f79, 0x7f7a, 0x7f7b, 0x7f7c, 0x7f7d, 0x7f7e, 0x7f7f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
111 0x7f80, 0x7f81, 0x7f82, 0x7f83, 0x7f84, 0x7f85, 0x7f86, 0x7f87,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
112 0x7f88, 0x7f89, 0x7f8a, 0x7f8b, 0x7f8c, 0x7f8d, 0x7f8e, 0x7f8f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
113 0x7f90, 0x7f91, 0x7f92, 0x7f93, 0x7f94, 0x7f95, 0x7f96, 0x7f97,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
114 0x7f98, 0x7f99, 0x7f9a, 0x7f9b, 0x7f9c, 0x7f9d, 0x7f9e, 0x7f9f,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
115 0x7fa0, 0x7fa1, 0x7fa2, 0x7fa3, 0x7fa4, 0x7fa5, 0x7fa6, 0x7fa7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
116 0x7fa8, 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7faf,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
117 0x7fb0, 0x7fb1, 0x7fb2, 0x7fb3, 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
118 0x7fb8, 0x7fb9, 0x7fba, 0x7fbb, 0x7fbc, 0x7fbd, 0x7fbe, 0x7fbf,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
119 0x7fc0, 0x7fc1, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc5, 0x7fc6, 0x7fc7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
120 0x7fc8, 0x7fc9, 0x7fca, 0x7fcb, 0x7fcc, 0x7fcd, 0x7fce, 0x7fcf,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
121 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd4, 0x7fd5, 0x7fd6, 0x7fd7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
122 0x7fd8, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fdf,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
123 0x7fe0, 0x7fe1, 0x7fe2, 0x7fe3, 0x7fe4, 0x7fe5, 0x7fe6, 0x7fe7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
124 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
125 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
126 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
127 0x0006,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
128 };
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
129
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1036
diff changeset
130 static const uint8_t dv_vlc_len[409] = {
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
131 2, 3, 4, 4, 4, 5, 5, 5,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
132 5, 6, 6, 6, 6, 7, 7, 7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
133 7, 7, 7, 7, 7, 8, 8, 8,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
134 8, 8, 8, 8, 8, 8, 8, 8,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
135 8, 8, 8, 8, 8, 9, 9, 9,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
136 9, 9, 9, 9, 9, 9, 9, 9,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
137 9, 9, 9, 9, 9, 10, 10, 10,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
138 10, 10, 10, 10, 11, 11, 11, 11,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
139 11, 11, 11, 11, 12, 12, 12, 12,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
140 12, 12, 12, 12, 12, 12, 12, 12,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
141 12, 12, 12, 12, 12, 12, 12, 12,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
142 13, 13, 13, 13, 13, 13, 13, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
143 13, 13, 13, 13, 13, 13, 13, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
144 13, 13, 13, 13, 13, 13, 13, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
145 13, 13, 13, 13, 13, 13, 13, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
146 13, 13, 13, 13, 13, 13, 13, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
147 13, 13, 13, 13, 13, 13, 13, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
148 13, 13, 13, 13, 13, 13, 13, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
149 13, 13, 13, 13, 13, 13, 13, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
150 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
151 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
152 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
153 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
154 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
155 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
156 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
157 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
158 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
159 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
160 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
161 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
162 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
163 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
164 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
165 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
166 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
167 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
168 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
169 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
170 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
171 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
172 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
173 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
174 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
175 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
176 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
177 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
178 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
179 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
180 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
181 15, 15, 15, 15, 15, 15, 15, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
182 4,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
183 };
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
184
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1036
diff changeset
185 static const uint8_t dv_vlc_run[409] = {
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
186 0, 0, 1, 0, 0, 2, 1, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
187 0, 3, 4, 0, 0, 5, 6, 2,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
188 1, 1, 0, 0, 0, 7, 8, 9,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
189 10, 3, 4, 2, 1, 1, 1, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
190 0, 0, 0, 0, 0, 11, 12, 13,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
191 14, 5, 6, 3, 4, 2, 2, 1,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
192 0, 0, 0, 0, 0, 5, 3, 3,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
193 2, 1, 1, 1, 0, 1, 6, 4,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
194 3, 1, 1, 1, 2, 3, 4, 5,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
195 7, 8, 9, 10, 7, 8, 4, 3,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
196 2, 2, 2, 2, 2, 1, 1, 1,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
197 0, 1, 2, 3, 4, 5, 6, 7,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
198 8, 9, 10, 11, 12, 13, 14, 15,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
199 16, 17, 18, 19, 20, 21, 22, 23,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
200 24, 25, 26, 27, 28, 29, 30, 31,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
201 32, 33, 34, 35, 36, 37, 38, 39,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
202 40, 41, 42, 43, 44, 45, 46, 47,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
203 48, 49, 50, 51, 52, 53, 54, 55,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
204 56, 57, 58, 59, 60, 61, 62, 63,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
205 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
206 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
207 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
208 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
209 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
210 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
211 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
212 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
213 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
214 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
215 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
216 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
217 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
218 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
219 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
220 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
221 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
222 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
223 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
224 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
225 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
226 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
227 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
228 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
229 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
230 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
231 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
232 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
233 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
234 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
235 0, 0, 0, 0, 0, 0, 0, 0,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
236 0, 0, 0, 0, 0, 0, 0, 0,
1886
fbcf02596520 * DV decoder simplifications. Now it looks to be 6% faster. At least
romansh
parents: 1631
diff changeset
237 127,
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
238 };
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
239
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1036
diff changeset
240 static const uint8_t dv_vlc_level[409] = {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
241 1, 2, 1, 3, 4, 1, 2, 5,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
242 6, 1, 1, 7, 8, 1, 1, 2,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
243 3, 4, 9, 10, 11, 1, 1, 1,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
244 1, 2, 2, 3, 5, 6, 7, 12,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
245 13, 14, 15, 16, 17, 1, 1, 1,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
246 1, 2, 2, 3, 3, 4, 5, 8,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
247 18, 19, 20, 21, 22, 3, 4, 5,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
248 6, 9, 10, 11, 0, 0, 3, 4,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
249 6, 12, 13, 14, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
250 2, 2, 2, 2, 3, 3, 5, 7,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
251 7, 8, 9, 10, 11, 15, 16, 17,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
252 0, 0, 0, 0, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
253 0, 0, 0, 0, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
254 0, 0, 0, 0, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
255 0, 0, 0, 0, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
256 0, 0, 0, 0, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
257 0, 0, 0, 0, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
258 0, 0, 0, 0, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
259 0, 0, 0, 0, 0, 0, 0, 0,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
260 0, 1, 2, 3, 4, 5, 6, 7,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
261 8, 9, 10, 11, 12, 13, 14, 15,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
262 16, 17, 18, 19, 20, 21, 22, 23,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
263 24, 25, 26, 27, 28, 29, 30, 31,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
264 32, 33, 34, 35, 36, 37, 38, 39,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
265 40, 41, 42, 43, 44, 45, 46, 47,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
266 48, 49, 50, 51, 52, 53, 54, 55,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
267 56, 57, 58, 59, 60, 61, 62, 63,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
268 64, 65, 66, 67, 68, 69, 70, 71,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
269 72, 73, 74, 75, 76, 77, 78, 79,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
270 80, 81, 82, 83, 84, 85, 86, 87,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
271 88, 89, 90, 91, 92, 93, 94, 95,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
272 96, 97, 98, 99, 100, 101, 102, 103,
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
273 104, 105, 106, 107, 108, 109, 110, 111,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
274 112, 113, 114, 115, 116, 117, 118, 119,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
275 120, 121, 122, 123, 124, 125, 126, 127,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
276 128, 129, 130, 131, 132, 133, 134, 135,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
277 136, 137, 138, 139, 140, 141, 142, 143,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
278 144, 145, 146, 147, 148, 149, 150, 151,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
279 152, 153, 154, 155, 156, 157, 158, 159,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
280 160, 161, 162, 163, 164, 165, 166, 167,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
281 168, 169, 170, 171, 172, 173, 174, 175,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
282 176, 177, 178, 179, 180, 181, 182, 183,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
283 184, 185, 186, 187, 188, 189, 190, 191,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
284 192, 193, 194, 195, 196, 197, 198, 199,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
285 200, 201, 202, 203, 204, 205, 206, 207,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
286 208, 209, 210, 211, 212, 213, 214, 215,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
287 216, 217, 218, 219, 220, 221, 222, 223,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
288 224, 225, 226, 227, 228, 229, 230, 231,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
289 232, 233, 234, 235, 236, 237, 238, 239,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
290 240, 241, 242, 243, 244, 245, 246, 247,
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
291 248, 249, 250, 251, 252, 253, 254, 255,
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
292 0,
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
293 };
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
294
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
295 /* unquant tables (not used directly) */
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
296 static const uint8_t dv_quant_shifts[22][4] = {
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
297 { 3,3,4,4 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
298 { 3,3,4,4 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
299 { 2,3,3,4 },
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
300 { 2,3,3,4 },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
301 { 2,2,3,3 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
302 { 2,2,3,3 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
303 { 1,2,2,3 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
304 { 1,2,2,3 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
305 { 1,1,2,2 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
306 { 1,1,2,2 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
307 { 0,1,1,2 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
308 { 0,1,1,2 },
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
309 { 0,0,1,1 },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
310 { 0,0,1,1 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
311 { 0,0,0,1 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
312 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
313 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
314 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
315 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
316 { 0,0,0,0 },
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
317 { 0,0,0,0 },
723
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
318 { 0,0,0,0 },
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
319 };
50f7e3bef20f first working version of DV video decoder
bellard
parents:
diff changeset
320
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
321 static const uint8_t dv_quant_offset[4] = { 6, 3, 0, 1 };
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
322 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
323
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
324 /* quantization quanta by QNO for DV100 */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
325 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
326 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
327 1,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
328 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
329 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
330
3149
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
331 /* 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
332 /* created by dvtables.py */
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
333 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
334 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
335 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
336 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
337 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
338 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
339 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
340 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
341 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
342 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
343 };
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
344 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
345 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
346 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
347 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
348 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
349 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
350 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
351 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
352 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
353 };
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
354 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
355 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
356 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
357 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
358 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
359 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
360 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
361 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
362 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
363 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
364 };
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
365 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
366 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
367 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
368 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
369 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
370 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
371 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
372 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
373 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
374 };
2679184e8be0 AC coefficient weighing (per SMPTE 314M) for the DV encoder and decoder. The
romansh
parents: 3036
diff changeset
375
8009
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
376 /**
8050
4eac1822bc65 spelling cosmetics
diego
parents: 8042
diff changeset
377 * The "inverse" DV100 weights are actually just the spec weights (zig-zagged).
8009
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
378 */
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
379 static const int dv_iweight_1080_y[64] = {
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
380 128, 16, 16, 17, 17, 17, 18, 18,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
381 18, 18, 18, 18, 19, 18, 18, 19,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
382 19, 19, 19, 19, 19, 42, 38, 40,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
383 40, 40, 38, 42, 44, 43, 41, 41,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
384 41, 41, 43, 44, 45, 45, 42, 42,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
385 42, 45, 45, 48, 46, 43, 43, 46,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
386 48, 49, 48, 44, 48, 49, 101, 98,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
387 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
388 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
389 static const int dv_iweight_1080_c[64] = {
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
390 128, 16, 16, 17, 17, 17, 25, 25,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
391 25, 25, 26, 25, 26, 25, 26, 26,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
392 26, 27, 27, 26, 26, 42, 38, 40,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
393 40, 40, 38, 42, 44, 43, 41, 41,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
394 41, 41, 43, 44, 91, 91, 84, 84,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
395 84, 91, 91, 96, 93, 86, 86, 93,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
396 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
397 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
398 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
399 static const int dv_iweight_720_y[64] = {
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
400 128, 16, 16, 17, 17, 17, 18, 18,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
401 18, 18, 18, 18, 19, 18, 18, 19,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
402 19, 19, 19, 19, 19, 42, 38, 40,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
403 40, 40, 38, 42, 44, 43, 41, 41,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
404 41, 41, 43, 44, 68, 68, 63, 63,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
405 63, 68, 68, 96, 92, 86, 86, 92,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
406 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
407 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
408 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
409 static const int dv_iweight_720_c[64] = {
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
410 128, 24, 24, 26, 26, 26, 36, 36,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
411 36, 36, 36, 36, 38, 36, 36, 38,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
412 38, 38, 38, 38, 38, 84, 76, 80,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
413 80, 80, 76, 84, 88, 86, 82, 82,
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
414 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
415 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
416 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
417 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
418 };
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
419
4361
f80a3b6c6f00 uint16->uint8
michael
parents: 3947
diff changeset
420 static const uint8_t dv_audio_shuffle525[10][9] = {
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
421 { 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
422 { 6, 36, 66, 26, 56, 86, 16, 46, 76 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
423 { 12, 42, 72, 2, 32, 62, 22, 52, 82 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
424 { 18, 48, 78, 8, 38, 68, 28, 58, 88 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
425 { 24, 54, 84, 14, 44, 74, 4, 34, 64 },
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
426
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
427 { 1, 31, 61, 21, 51, 81, 11, 41, 71 }, /* 2nd channel */
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
428 { 7, 37, 67, 27, 57, 87, 17, 47, 77 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
429 { 13, 43, 73, 3, 33, 63, 23, 53, 83 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
430 { 19, 49, 79, 9, 39, 69, 29, 59, 89 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
431 { 25, 55, 85, 15, 45, 75, 5, 35, 65 },
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
432 };
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
433
4361
f80a3b6c6f00 uint16->uint8
michael
parents: 3947
diff changeset
434 static const uint8_t dv_audio_shuffle625[12][9] = {
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
435 { 0, 36, 72, 26, 62, 98, 16, 52, 88}, /* 1st channel */
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
436 { 6, 42, 78, 32, 68, 104, 22, 58, 94},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
437 { 12, 48, 84, 2, 38, 74, 28, 64, 100},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
438 { 18, 54, 90, 8, 44, 80, 34, 70, 106},
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
439 { 24, 60, 96, 14, 50, 86, 4, 40, 76},
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
440 { 30, 66, 102, 20, 56, 92, 10, 46, 82},
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
441
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
442 { 1, 37, 73, 27, 63, 99, 17, 53, 89}, /* 2nd channel */
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
443 { 7, 43, 79, 33, 69, 105, 23, 59, 95},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
444 { 13, 49, 85, 3, 39, 75, 29, 65, 101},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
445 { 19, 55, 91, 9, 45, 81, 35, 71, 107},
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
446 { 25, 61, 97, 15, 51, 87, 5, 41, 77},
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
447 { 31, 67, 103, 21, 57, 93, 11, 47, 83},
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
448 };
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
449
5083
ce36118abbbb rename attribute_unused to av_unused and moves its declaration to common.h
benoit
parents: 5006
diff changeset
450 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
451 48000, 44100, 32000,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
452 };
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
453
7616
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
454 /* macroblock bit budgets */
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
455 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
456 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
457 };
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
458
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
459 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
460 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
461 };
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
462
8131
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
463 static DVwork_chunk work_chunks_dv25pal [1*12*27];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
464 static DVwork_chunk work_chunks_dv25pal411[1*12*27];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
465 static DVwork_chunk work_chunks_dv25ntsc [1*10*27];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
466 static DVwork_chunk work_chunks_dv50pal [2*12*27];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
467 static DVwork_chunk work_chunks_dv50ntsc [2*10*27];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
468 static DVwork_chunk work_chunks_dv100palp [2*12*27];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
469 static DVwork_chunk work_chunks_dv100ntscp[2*10*27];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
470 static DVwork_chunk work_chunks_dv100pali [4*12*27];
c30bdda1adb1 Taking advantage of the new ->execute API
romansh
parents: 8118
diff changeset
471 static DVwork_chunk work_chunks_dv100ntsci[4*10*27];
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
472
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
473 static uint32_t dv_idct_factor_sd [2*2*22*64];
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
474 static uint32_t dv_idct_factor_hd1080[2*4*16*64];
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
475 static uint32_t dv_idct_factor_hd720 [2*4*16*64];
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
476
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
477 static const DVprofile dv_profiles[] = {
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
478 { .dsf = 0,
7714
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
479 .video_stype = 0x0,
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
480 .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
481 .difseg_size = 10,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
482 .n_difchan = 1,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
483 .time_base = { 1001, 30000 },
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
484 .ltc_divisor = 30,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
485 .height = 480,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
486 .width = 720,
2228
f9411c92f7e6 * I was finally convinced. And besides, if err it's better to err with
romansh
parents: 1886
diff changeset
487 .sar = {{10, 11}, {40, 33}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
488 .work_chunks = &work_chunks_dv25ntsc[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
489 .idct_factor = &dv_idct_factor_sd[0],
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
490 .pix_fmt = PIX_FMT_YUV411P,
7615
290fd3ae1219 Making the number of blocks per macroblock dependent on the DV stream
romansh
parents: 7614
diff changeset
491 .bpm = 6,
7616
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
492 .block_sizes = block_sizes_dv2550,
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
493 .audio_stride = 90,
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
494 .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
495 .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
496 .audio_shuffle = dv_audio_shuffle525,
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2228
diff changeset
497 },
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
498 { .dsf = 1,
7714
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
499 .video_stype = 0x0,
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
500 .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
501 .difseg_size = 12,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
502 .n_difchan = 1,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
503 .time_base = { 1, 25 },
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
504 .ltc_divisor = 25,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
505 .height = 576,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
506 .width = 720,
2228
f9411c92f7e6 * I was finally convinced. And besides, if err it's better to err with
romansh
parents: 1886
diff changeset
507 .sar = {{59, 54}, {118, 81}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
508 .work_chunks = &work_chunks_dv25pal[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
509 .idct_factor = &dv_idct_factor_sd[0],
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
510 .pix_fmt = PIX_FMT_YUV420P,
7615
290fd3ae1219 Making the number of blocks per macroblock dependent on the DV stream
romansh
parents: 7614
diff changeset
511 .bpm = 6,
7616
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
512 .block_sizes = block_sizes_dv2550,
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
513 .audio_stride = 108,
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
514 .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
515 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
516 .audio_shuffle = dv_audio_shuffle625,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
517 },
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
518 { .dsf = 1,
7714
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
519 .video_stype = 0x0,
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
520 .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
521 .difseg_size = 12,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
522 .n_difchan = 1,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
523 .time_base = { 1, 25 },
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
524 .ltc_divisor = 25,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
525 .height = 576,
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
526 .width = 720,
2228
f9411c92f7e6 * I was finally convinced. And besides, if err it's better to err with
romansh
parents: 1886
diff changeset
527 .sar = {{59, 54}, {118, 81}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
528 .work_chunks = &work_chunks_dv25pal411[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
529 .idct_factor = &dv_idct_factor_sd[0],
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
530 .pix_fmt = PIX_FMT_YUV411P,
7615
290fd3ae1219 Making the number of blocks per macroblock dependent on the DV stream
romansh
parents: 7614
diff changeset
531 .bpm = 6,
7616
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
532 .block_sizes = block_sizes_dv2550,
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
533 .audio_stride = 108,
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
534 .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
535 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
536 .audio_shuffle = dv_audio_shuffle625,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
537 },
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
538 { .dsf = 0,
7714
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
539 .video_stype = 0x4,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
540 .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
541 .difseg_size = 10, /* also known as "DVCPRO50" */
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
542 .n_difchan = 2,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
543 .time_base = { 1001, 30000 },
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
544 .ltc_divisor = 30,
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
545 .height = 480,
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
546 .width = 720,
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
547 .sar = {{10, 11}, {40, 33}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
548 .work_chunks = &work_chunks_dv50ntsc[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
549 .idct_factor = &dv_idct_factor_sd[0],
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
550 .pix_fmt = PIX_FMT_YUV422P,
7615
290fd3ae1219 Making the number of blocks per macroblock dependent on the DV stream
romansh
parents: 7614
diff changeset
551 .bpm = 6,
7616
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
552 .block_sizes = block_sizes_dv2550,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
553 .audio_stride = 90,
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
554 .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
555 .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
556 .audio_shuffle = dv_audio_shuffle525,
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
557 },
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
558 { .dsf = 1,
7714
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
559 .video_stype = 0x4,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
560 .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
561 .difseg_size = 12, /* also known as "DVCPRO50" */
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
562 .n_difchan = 2,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
563 .time_base = { 1, 25 },
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
564 .ltc_divisor = 25,
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
565 .height = 576,
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
566 .width = 720,
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
567 .sar = {{59, 54}, {118, 81}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
568 .work_chunks = &work_chunks_dv50pal[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
569 .idct_factor = &dv_idct_factor_sd[0],
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
570 .pix_fmt = PIX_FMT_YUV422P,
7615
290fd3ae1219 Making the number of blocks per macroblock dependent on the DV stream
romansh
parents: 7614
diff changeset
571 .bpm = 6,
7616
685ef77c9fe5 Making block size in bits variable and dependent on the DV spec
romansh
parents: 7615
diff changeset
572 .block_sizes = block_sizes_dv2550,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
573 .audio_stride = 108,
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
574 .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
575 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
576 .audio_shuffle = dv_audio_shuffle625,
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
577 },
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
578 { .dsf = 0,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
579 .video_stype = 0x14,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
580 .frame_size = 480000, /* SMPTE-370M - 1080i60 100 Mbps */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
581 .difseg_size = 10, /* also known as "DVCPRO HD" */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
582 .n_difchan = 4,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
583 .time_base = { 1001, 30000 },
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
584 .ltc_divisor = 30,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
585 .height = 1080,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
586 .width = 1280,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
587 .sar = {{1, 1}, {1, 1}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
588 .work_chunks = &work_chunks_dv100ntsci[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
589 .idct_factor = &dv_idct_factor_hd1080[0],
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
590 .pix_fmt = PIX_FMT_YUV422P,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
591 .bpm = 8,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
592 .block_sizes = block_sizes_dv100,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
593 .audio_stride = 90,
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
594 .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
595 .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
596 .audio_shuffle = dv_audio_shuffle525,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
597 },
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
598 { .dsf = 1,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
599 .video_stype = 0x14,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
600 .frame_size = 576000, /* SMPTE-370M - 1080i50 100 Mbps */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
601 .difseg_size = 12, /* also known as "DVCPRO HD" */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
602 .n_difchan = 4,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
603 .time_base = { 1, 25 },
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
604 .ltc_divisor = 25,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
605 .height = 1080,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
606 .width = 1440,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
607 .sar = {{1, 1}, {1, 1}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
608 .work_chunks = &work_chunks_dv100pali[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
609 .idct_factor = &dv_idct_factor_hd1080[0],
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
610 .pix_fmt = PIX_FMT_YUV422P,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
611 .bpm = 8,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
612 .block_sizes = block_sizes_dv100,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
613 .audio_stride = 108,
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
614 .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
615 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
616 .audio_shuffle = dv_audio_shuffle625,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
617 },
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
618 { .dsf = 0,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
619 .video_stype = 0x18,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
620 .frame_size = 240000, /* SMPTE-370M - 720p60 100 Mbps */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
621 .difseg_size = 10, /* also known as "DVCPRO HD" */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
622 .n_difchan = 2,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
623 .time_base = { 1001, 60000 },
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
624 .ltc_divisor = 60,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
625 .height = 720,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
626 .width = 960,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
627 .sar = {{1, 1}, {1, 1}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
628 .work_chunks = &work_chunks_dv100ntscp[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
629 .idct_factor = &dv_idct_factor_hd720[0],
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
630 .pix_fmt = PIX_FMT_YUV422P,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
631 .bpm = 8,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
632 .block_sizes = block_sizes_dv100,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
633 .audio_stride = 90,
8012
8b39df76fe9a vertically aligning as per Michael's suggestion
romansh
parents: 8009
diff changeset
634 .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
635 .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
636 .audio_shuffle = dv_audio_shuffle525,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
637 },
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
638 { .dsf = 1,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
639 .video_stype = 0x18,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
640 .frame_size = 288000, /* SMPTE-370M - 720p50 100 Mbps */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
641 .difseg_size = 12, /* also known as "DVCPRO HD" */
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
642 .n_difchan = 2,
8014
07d8986fbea7 replacing frame_rate and frame_rate_base with an AVRational time_base
romansh
parents: 8013
diff changeset
643 .time_base = { 1, 50 },
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
644 .ltc_divisor = 50,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
645 .height = 720,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
646 .width = 960,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
647 .sar = {{1, 1}, {1, 1}},
8118
890df98a7848 implementing more efficient (and direct) allocation of work for DV codec workers
romansh
parents: 8051
diff changeset
648 .work_chunks = &work_chunks_dv100palp[0],
8175
0d1c9c936a52 Making idct factor tables dynamically allocated
romansh
parents: 8164
diff changeset
649 .idct_factor = &dv_idct_factor_hd720[0],
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
650 .pix_fmt = PIX_FMT_YUV422P,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
651 .bpm = 8,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
652 .block_sizes = block_sizes_dv100,
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
653 .audio_stride = 90,
8713
fa6d97b7f4e8 fix decoding 720p50 audio samples
bcoudurier
parents: 8629
diff changeset
654 .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
fa6d97b7f4e8 fix decoding 720p50 audio samples
bcoudurier
parents: 8629
diff changeset
655 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
fa6d97b7f4e8 fix decoding 720p50 audio samples
bcoudurier
parents: 8629
diff changeset
656 .audio_shuffle = dv_audio_shuffle625,
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
657 }
1036
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
658 };
c7922c5becf6 DV audio decoder by Roman Shaposhnick
bellard
parents: 723
diff changeset
659
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
660 enum dv_section_type {
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
661 dv_sect_header = 0x1f,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
662 dv_sect_subcode = 0x3f,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
663 dv_sect_vaux = 0x56,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
664 dv_sect_audio = 0x76,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
665 dv_sect_video = 0x96,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
666 };
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
667
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
668 enum dv_pack_type {
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
669 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
670 dv_header625 = 0xbf, /* these two packs */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
671 dv_timecode = 0x13,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
672 dv_audio_source = 0x50,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
673 dv_audio_control = 0x51,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
674 dv_audio_recdate = 0x52,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
675 dv_audio_rectime = 0x53,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
676 dv_video_source = 0x60,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
677 dv_video_control = 0x61,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
678 dv_video_recdate = 0x62,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
679 dv_video_rectime = 0x63,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
680 dv_unknown_pack = 0xff,
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
681 };
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
682
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
683 #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
684 #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
685 #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
686
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
687 /* minimum number of bytes to read from a DV stream in order to
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
688 determine the profile */
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
689 #define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
690
8009
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
691 /**
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
692 * largest possible DV frame, in bytes (1080i50)
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
693 */
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
694 #define DV_MAX_FRAME_SIZE 576000
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
695
8009
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
696 /**
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
697 * maximum number of blocks per macroblock in any DV format
f7c7ef5e448b Doxygenizing the comments
romansh
parents: 7980
diff changeset
698 */
7614
1afa1171b7b2 Introducing DV_MAX_BPM macro instead of a hardcoded value for the
romansh
parents: 7538
diff changeset
699 #define DV_MAX_BPM 8
1afa1171b7b2 Introducing DV_MAX_BPM macro instead of a hardcoded value for the
romansh
parents: 7538
diff changeset
700
6266
6e160e75eb9c some const
michael
parents: 6132
diff changeset
701 static inline const DVprofile* dv_frame_profile(const uint8_t* frame)
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
702 {
7714
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
703 int i;
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
704
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
705 int dsf = (frame[3] & 0x80) >> 7;
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
706
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
707 int stype = frame[80*5 + 48 + 3] & 0x1f;
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
708
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
709 /* 576i50 25Mbps 4:1:1 is a special case */
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
710 if (dsf == 1 && stype == 0 && frame[5] & 0x07) {
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
711 return &dv_profiles[2];
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
712 }
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
713
8042
e70975d5ff80 uses FF_ARRAY_ELEMS() where appropriate
aurel
parents: 8014
diff changeset
714 for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
7714
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
715 if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
716 return &dv_profiles[i];
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
717
f0f8bb920b24 Introducing video_stype for holding the value of VAUX source pack
romansh
parents: 7616
diff changeset
718 return NULL;
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
719 }
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
720
8013
0eeb93cedecb cosmetic updates as per Michael's suggestion
romansh
parents: 8012
diff changeset
721 static const DVprofile* dv_codec_profile(AVCodecContext* codec)
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
722 {
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
723 int i;
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
724
8042
e70975d5ff80 uses FF_ARRAY_ELEMS() where appropriate
aurel
parents: 8014
diff changeset
725 for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
726 if (codec->height == dv_profiles[i].height &&
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
727 codec->pix_fmt == dv_profiles[i].pix_fmt &&
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
728 codec->width == dv_profiles[i].width)
7715
e8f71784062e Intial implementation of the DV100 (AKA DVCPRO HD) decoder and demuxer as
romansh
parents: 7714
diff changeset
729 return &dv_profiles[i];
3167
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
730
312b86bc4202 DVCPRO50 support.
romansh
parents: 3149
diff changeset
731 return NULL;
1489
337d13aee605 * DV handling was streamlined for both muxing/demuxing and
romansh
parents: 1167
diff changeset
732 }
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
733
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
734 static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
735 uint8_t seq_num, uint8_t dif_num,
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
736 uint8_t* buf)
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
737 {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
738 buf[0] = (uint8_t)t; /* Section type */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
739 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
740 (chan_num << 3) | /* FSC: for 50Mb/s 0 - first channel; 1 - second */
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
741 7; /* reserved -- always 1 */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
742 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
743 return 3;
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
744 }
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
745
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
746
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
747 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
748 {
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
749 if (syb_num == 0 || syb_num == 6) {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
750 buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
751 (0 << 4) | /* AP3 (Subcode application ID) */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
752 0x0f; /* reserved -- always 1 */
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
753 }
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
754 else if (syb_num == 11) {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
755 buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
756 0x7f; /* reserved -- always 1 */
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
757 }
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
758 else {
8051
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
759 buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
760 (0 << 4) | /* APT (Track application ID) */
fed91eaa6444 prettyprinting cosmetics
diego
parents: 8050
diff changeset
761 0x0f; /* reserved -- always 1 */
3671
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
762 }
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
763 buf[1] = 0xf0 | /* reserved -- always 1 */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
764 (syb_num & 0x0f); /* SSYB number 0 - 11 */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
765 buf[2] = 0xff; /* reserved -- always 1 */
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
766 return 3;
18113845d891 * Restructuring the division of labor between DV codec and DV format
romansh
parents: 3167
diff changeset
767 }
5163
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 5162
diff changeset
768
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7715
diff changeset
769 #endif /* AVCODEC_DVDATA_H */