Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
75f2c209
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
75f2c209
编写于
10月 24, 2008
作者:
D
Diego Biurrun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
spelling cosmetics
Originally committed as revision 15681 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
4599d22c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
30 deletion
+32
-30
libavcodec/dv.c
libavcodec/dv.c
+7
-7
libavcodec/dvdata.h
libavcodec/dvdata.h
+1
-1
libavformat/dv.c
libavformat/dv.c
+5
-3
libavformat/dvenc.c
libavformat/dvenc.c
+19
-19
未找到文件。
libavcodec/dv.c
浏览文件 @
75f2c209
...
...
@@ -138,7 +138,7 @@ static av_cold int dvvideo_init(AVCodecContext *avctx)
done
=
1
;
/* dv_anchor lets each thread know its I
d
*/
/* dv_anchor lets each thread know its I
D
*/
for
(
i
=
0
;
i
<
DV_ANCHOR_SIZE
;
i
++
)
dv_anchor
[
i
]
=
(
void
*
)(
size_t
)
i
;
...
...
@@ -967,7 +967,7 @@ static inline void dv_encode_video_segment(DVVideoContext *s,
}
}
/* Third and final pass over the whole vide
s
segment space */
/* Third and final pass over the whole vide
o
segment space */
pb
=
&
pbs
[
0
];
for
(
j
=
0
;
j
<
5
*
6
;
j
++
)
{
if
(
enc_blks
[
j
].
partial_bit_count
)
...
...
@@ -1119,7 +1119,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, ui
buf
[
1
]
=
0xff
;
/* reserved -- always 1 */
buf
[
2
]
=
(
1
<<
7
)
|
/* B/W: 0 - b/w, 1 - color */
(
1
<<
6
)
|
/* following CLF is valid - 0, invalid - 1 */
(
3
<<
4
)
|
/* CLF: color frames
id
(see ITU-R BT.470-4) */
(
3
<<
4
)
|
/* CLF: color frames
ID
(see ITU-R BT.470-4) */
0xf
;
/* reserved -- always 1 */
buf
[
3
]
=
(
3
<<
6
)
|
/* reserved -- always 1 */
(
c
->
sys
->
dsf
<<
5
)
|
/* system: 60fields/50fields */
...
...
@@ -1131,9 +1131,9 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, ui
0x3f
;
/* reserved -- always 1 */
buf
[
2
]
=
0xc8
|
/* reserved -- always b11001xxx */
aspect
;
buf
[
3
]
=
(
1
<<
7
)
|
/*
F
rame/field flag 1 -- frame, 0 -- field */
(
1
<<
6
)
|
/*
F
irst/second field flag 0 -- field 2, 1 -- field 1 */
(
1
<<
5
)
|
/*
F
rame change flag 0 -- same picture as before, 1 -- different */
buf
[
3
]
=
(
1
<<
7
)
|
/*
f
rame/field flag 1 -- frame, 0 -- field */
(
1
<<
6
)
|
/*
f
irst/second field flag 0 -- field 2, 1 -- field 1 */
(
1
<<
5
)
|
/*
f
rame change flag 0 -- same picture as before, 1 -- different */
(
1
<<
4
)
|
/* 1 - interlaced, 0 - noninterlaced */
0xc
;
/* reserved -- always b1100 */
buf
[
4
]
=
0xff
;
/* reserved -- always 1 */
...
...
@@ -1151,7 +1151,7 @@ static void dv_format_frame(DVVideoContext* c, uint8_t* buf)
for
(
chan
=
0
;
chan
<
c
->
sys
->
n_difchan
;
chan
++
)
{
for
(
i
=
0
;
i
<
c
->
sys
->
difseg_size
;
i
++
)
{
memset
(
buf
,
0xff
,
80
*
6
);
/*
F
irst 6 DIF blocks are for control data */
memset
(
buf
,
0xff
,
80
*
6
);
/*
f
irst 6 DIF blocks are for control data */
/* DV header: 1DIF */
buf
+=
dv_write_dif_id
(
dv_sect_header
,
chan
,
i
,
0
,
buf
);
...
...
libavcodec/dvdata.h
浏览文件 @
75f2c209
...
...
@@ -6073,7 +6073,7 @@ static const int dv_iweight_248[64] = {
};
/**
*
the "inverse" DV100 weights are actually just the spec weights (zig-zagged)
*
The "inverse" DV100 weights are actually just the spec weights (zig-zagged).
*/
static
const
int
dv_iweight_1080_y
[
64
]
=
{
128
,
16
,
16
,
17
,
17
,
17
,
18
,
18
,
...
...
libavformat/dv.c
浏览文件 @
75f2c209
...
...
@@ -116,12 +116,13 @@ static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
quant
=
as_pack
[
4
]
&
0x07
;
/* 0 - 16bit linear, 1 - 12bit nonlinear */
if
(
quant
>
1
)
return
-
1
;
/*
U
nsupported quantization */
return
-
1
;
/*
u
nsupported quantization */
size
=
(
sys
->
audio_min_samples
[
freq
]
+
smpls
)
*
4
;
/* 2ch, 2bytes */
half_ch
=
sys
->
difseg_size
/
2
;
/* We work with 720p frames split in half, thus even frames have channels 0,1 and odd 2,3 */
/* We work with 720p frames split in half, thus even frames have
* channels 0,1 and odd 2,3 */
ipcm
=
(
sys
->
height
==
720
&&
!
(
frame
[
1
]
&
0x0C
))
?
2
:
0
;
pcm
=
ppcm
[
ipcm
++
];
...
...
@@ -335,7 +336,8 @@ int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
dv_extract_audio
(
buf
,
ppcm
,
c
->
sys
);
c
->
abytes
+=
size
;
/* We work with 720p frames split in half, thus even frames have channels 0,1 and odd 2,3 */
/* We work with 720p frames split in half, thus even frames have
* channels 0,1 and odd 2,3. */
if
(
c
->
sys
->
height
==
720
)
{
if
(
buf
[
1
]
&
0x0C
)
c
->
audio_pkt
[
2
].
size
=
c
->
audio_pkt
[
3
].
size
=
0
;
...
...
libavformat/dvenc.c
浏览文件 @
75f2c209
...
...
@@ -35,12 +35,12 @@
#include "libavutil/fifo.h"
struct
DVMuxContext
{
const
DVprofile
*
sys
;
/* Current DV profile. E
.g.: 525/60, 625/50 */
int
n_ast
;
/* N
umber of stereo audio streams (up to 2) */
AVStream
*
ast
[
2
];
/* S
tereo audio streams */
const
DVprofile
*
sys
;
/* current DV profile, e
.g.: 525/60, 625/50 */
int
n_ast
;
/* n
umber of stereo audio streams (up to 2) */
AVStream
*
ast
[
2
];
/* s
tereo audio streams */
AVFifoBuffer
audio_data
[
2
];
/* FIFO for storing excessive amounts of PCM */
int
frames
;
/* Number of a current frame
*/
time_t
start_time
;
/* Start time of recording
*/
int
frames
;
/* current frame number
*/
time_t
start_time
;
/* recording start time
*/
int
has_audio
;
/* frame under contruction has audio */
int
has_video
;
/* frame under contruction has video */
uint8_t
frame_buf
[
DV_MAX_FRAME_SIZE
];
/* frame under contruction */
...
...
@@ -85,20 +85,20 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
* minute, unless it is exactly divisible by 10
*/
ltc_frame
=
(
c
->
frames
+
2
*
ct
/
60
-
2
*
ct
/
600
)
%
c
->
sys
->
ltc_divisor
;
buf
[
1
]
=
(
0
<<
7
)
|
/* Color f
ame: 0 - unsync; 1 - sync mode */
(
1
<<
6
)
|
/* D
rop frame timecode: 0 - nondrop; 1 - drop */
((
ltc_frame
/
10
)
<<
4
)
|
/* T
ens of frames */
(
ltc_frame
%
10
);
/* U
nits of frames */
buf
[
2
]
=
(
1
<<
7
)
|
/* B
iphase mark polarity correction: 0 - even; 1 - odd */
((
tc
.
tm_sec
/
10
)
<<
4
)
|
/* T
ens of seconds */
(
tc
.
tm_sec
%
10
);
/* U
nits of seconds */
buf
[
3
]
=
(
1
<<
7
)
|
/* B
inary group flag BGF0 */
((
tc
.
tm_min
/
10
)
<<
4
)
|
/* T
ens of minutes */
(
tc
.
tm_min
%
10
);
/* U
nits of minutes */
buf
[
4
]
=
(
1
<<
7
)
|
/* B
inary group flag BGF2 */
(
1
<<
6
)
|
/* B
inary group flag BGF1 */
((
tc
.
tm_hour
/
10
)
<<
4
)
|
/*
T
ens of hours */
(
tc
.
tm_hour
%
10
);
/*
U
nits of hours */
buf
[
1
]
=
(
0
<<
7
)
|
/* color fr
ame: 0 - unsync; 1 - sync mode */
(
1
<<
6
)
|
/* d
rop frame timecode: 0 - nondrop; 1 - drop */
((
ltc_frame
/
10
)
<<
4
)
|
/* t
ens of frames */
(
ltc_frame
%
10
);
/* u
nits of frames */
buf
[
2
]
=
(
1
<<
7
)
|
/* b
iphase mark polarity correction: 0 - even; 1 - odd */
((
tc
.
tm_sec
/
10
)
<<
4
)
|
/* t
ens of seconds */
(
tc
.
tm_sec
%
10
);
/* u
nits of seconds */
buf
[
3
]
=
(
1
<<
7
)
|
/* b
inary group flag BGF0 */
((
tc
.
tm_min
/
10
)
<<
4
)
|
/* t
ens of minutes */
(
tc
.
tm_min
%
10
);
/* u
nits of minutes */
buf
[
4
]
=
(
1
<<
7
)
|
/* b
inary group flag BGF2 */
(
1
<<
6
)
|
/* b
inary group flag BGF1 */
((
tc
.
tm_hour
/
10
)
<<
4
)
|
/*
t
ens of hours */
(
tc
.
tm_hour
%
10
);
/*
u
nits of hours */
break
;
case
dv_audio_source
:
/* AAUX source pack */
va_start
(
ap
,
buf
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录