Libav
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
libavcodec
dv.h
Go to the documentation of this file.
1
/*
2
* Constants for DV codec
3
* Copyright (c) 2002 Fabrice Bellard
4
*
5
* This file is part of Libav.
6
*
7
* Libav is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
11
*
12
* Libav is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with Libav; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
*/
21
27
#ifndef AVCODEC_DV_H
28
#define AVCODEC_DV_H
29
30
#include "
avcodec.h
"
31
#include "
dsputil.h
"
32
#include "
get_bits.h
"
33
#include "
dv_profile.h
"
34
35
typedef
struct
DVVideoContext
{
36
const
DVprofile
*
sys
;
37
AVFrame
*
frame
;
38
AVCodecContext
*
avctx
;
39
uint8_t
*
buf
;
40
41
uint8_t
dv_zigzag
[2][64];
42
43
void
(*
get_pixels
)(int16_t *
block
,
const
uint8_t
*pixels,
int
line_size);
44
void
(*
fdct
[2])(int16_t *
block
);
45
void
(*
idct_put
[2])(
uint8_t
*dest,
int
line_size, int16_t *
block
);
46
me_cmp_func
ildct_cmp
;
47
}
DVVideoContext
;
48
49
enum
dv_section_type
{
50
dv_sect_header
= 0x1f,
51
dv_sect_subcode
= 0x3f,
52
dv_sect_vaux
= 0x56,
53
dv_sect_audio
= 0x76,
54
dv_sect_video
= 0x96,
55
};
56
57
enum
dv_pack_type
{
58
dv_header525
= 0x3f,
/* see dv_write_pack for important details on */
59
dv_header625
= 0xbf,
/* these two packs */
60
dv_timecode
= 0x13,
61
dv_audio_source
= 0x50,
62
dv_audio_control
= 0x51,
63
dv_audio_recdate
= 0x52,
64
dv_audio_rectime
= 0x53,
65
dv_video_source
= 0x60,
66
dv_video_control
= 0x61,
67
dv_video_recdate
= 0x62,
68
dv_video_rectime
= 0x63,
69
dv_unknown_pack
= 0xff,
70
};
71
72
#define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10)
73
#define DV_PROFILE_IS_1080i50(p) (((p)->video_stype == 0x14) && ((p)->dsf == 1))
74
#define DV_PROFILE_IS_720p50(p) (((p)->video_stype == 0x18) && ((p)->dsf == 1))
75
76
/* minimum number of bytes to read from a DV stream in order to
77
determine the profile */
78
#define DV_PROFILE_BYTES (6*80)
/* 6 DIF blocks */
79
83
#define DV_MAX_FRAME_SIZE 576000
84
88
#define DV_MAX_BPM 8
89
90
#define TEX_VLC_BITS 9
91
92
extern
RL_VLC_ELEM
ff_dv_rl_vlc
[1184];
93
94
int
ff_dv_init_dynamic_tables
(
const
DVprofile
*d);
95
int
ff_dvvideo_init
(
AVCodecContext
*avctx);
96
97
static
inline
int
dv_work_pool_size
(
const
DVprofile
*d)
98
{
99
int
size
= d->
n_difchan
*d->
difseg_size
*27;
100
if
(
DV_PROFILE_IS_1080i50
(d))
101
size -= 3*27;
102
if
(
DV_PROFILE_IS_720p50
(d))
103
size -= 4*27;
104
return
size
;
105
}
106
107
static
inline
void
dv_calculate_mb_xy
(
DVVideoContext
*s,
DVwork_chunk
*work_chunk,
int
m,
int
*mb_x,
int
*mb_y)
108
{
109
*mb_x = work_chunk->
mb_coordinates
[m] & 0xff;
110
*mb_y = work_chunk->
mb_coordinates
[m] >> 8;
111
112
/* We work with 720p frames split in half. The odd half-frame (chan==2,3) is displaced :-( */
113
if
(s->
sys
->
height
== 720 && !(s->
buf
[1]&0x0C)) {
114
*mb_y -= (*mb_y>17)?18:-72;
/* shifting the Y coordinate down by 72/2 macro blocks */
115
}
116
}
117
118
#endif
/* AVCODEC_DV_H */
RL_VLC_ELEM
Definition:
get_bits.h:70
DVVideoContext::frame
AVFrame * frame
Definition:
dv.h:37
dv_audio_recdate
Definition:
dv.h:63
size
int size
Definition:
twinvq_data.h:11134
AVFrame
This structure describes decoded (raw) audio or video data.
Definition:
frame.h:107
me_cmp_func
int(* me_cmp_func)(void *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
Definition:
dsputil.h:106
dv_sect_vaux
Definition:
dv.h:52
DVVideoContext::ildct_cmp
me_cmp_func ildct_cmp
Definition:
dv.h:46
dv_video_source
Definition:
dv.h:65
dv_sect_audio
Definition:
dv.h:53
dv_video_control
Definition:
dv.h:66
DVVideoContext::buf
uint8_t * buf
Definition:
dv.h:39
DV_PROFILE_IS_1080i50
#define DV_PROFILE_IS_1080i50(p)
Definition:
dv.h:73
DVVideoContext::avctx
AVCodecContext * avctx
Definition:
dv.h:38
dv_pack_type
dv_pack_type
Definition:
dv.h:57
uint8_t
uint8_t
Definition:
audio_convert.c:194
DVVideoContext::idct_put
void(* idct_put[2])(uint8_t *dest, int line_size, int16_t *block)
Definition:
dv.h:45
dv_sect_video
Definition:
dv.h:54
dv_sect_subcode
Definition:
dv.h:51
get_bits.h
bitstream reader API header.
DV_PROFILE_IS_720p50
#define DV_PROFILE_IS_720p50(p)
Definition:
dv.h:74
dv_profile.h
DVVideoContext
Definition:
dv.h:35
dv_header525
Definition:
dv.h:58
DVwork_chunk::mb_coordinates
uint16_t mb_coordinates[5]
Definition:
dv_profile.h:30
dv_unknown_pack
Definition:
dv.h:69
DVprofile::height
int height
Definition:
dv_profile.h:47
dv_sect_header
Definition:
dv.h:50
DVprofile::n_difchan
int n_difchan
Definition:
dv_profile.h:44
dv_audio_rectime
Definition:
dv.h:64
DVprofile::difseg_size
int difseg_size
Definition:
dv_profile.h:43
DVVideoContext::sys
const DVprofile * sys
Definition:
dv.h:36
dv_video_recdate
Definition:
dv.h:67
DVwork_chunk
Definition:
dv_profile.h:28
DVVideoContext::fdct
void(* fdct[2])(int16_t *block)
Definition:
dv.h:44
ff_dvvideo_init
int ff_dvvideo_init(AVCodecContext *avctx)
Definition:
dv.c:239
avcodec.h
Libavcodec external API header.
dv_timecode
Definition:
dv.h:60
ff_dv_rl_vlc
RL_VLC_ELEM ff_dv_rl_vlc[1184]
Definition:
dv.c:52
AVCodecContext
main external API structure.
Definition:
avcodec.h:1054
void
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
DVVideoContext::dv_zigzag
uint8_t dv_zigzag[2][64]
Definition:
dv.h:41
DVVideoContext::get_pixels
void(* get_pixels)(int16_t *block, const uint8_t *pixels, int line_size)
Definition:
dv.h:43
dv_section_type
dv_section_type
Definition:
dv.h:49
dsputil.h
DSP utils.
ff_dv_init_dynamic_tables
int ff_dv_init_dynamic_tables(const DVprofile *d)
Definition:
dv.c:178
dv_calculate_mb_xy
static void dv_calculate_mb_xy(DVVideoContext *s, DVwork_chunk *work_chunk, int m, int *mb_x, int *mb_y)
Definition:
dv.h:107
dv_header625
Definition:
dv.h:59
dv_video_rectime
Definition:
dv.h:68
dv_audio_source
Definition:
dv.h:61
DVprofile
Definition:
dv_profile.h:39
dv_audio_control
Definition:
dv.h:62
dv_work_pool_size
static int dv_work_pool_size(const DVprofile *d)
Definition:
dv.h:97
block
static int16_t block[64]
Definition:
dct-test.c:170
Generated on Sun Jun 29 2014 13:23:50 for Libav by
1.8.7