Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
30952237
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,发现更多精彩内容 >>
提交
30952237
编写于
3月 31, 2003
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
some static -> dynamic alloc & 16->8 bit
Originally committed as revision 1722 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
8437bd7b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
30 deletion
+32
-30
libavcodec/h263.c
libavcodec/h263.c
+2
-2
libavcodec/motion_est.c
libavcodec/motion_est.c
+8
-8
libavcodec/motion_est_template.c
libavcodec/motion_est_template.c
+11
-11
libavcodec/mpeg12.c
libavcodec/mpeg12.c
+3
-1
libavcodec/mpegvideo.c
libavcodec/mpegvideo.c
+3
-3
libavcodec/mpegvideo.h
libavcodec/mpegvideo.h
+5
-5
未找到文件。
libavcodec/h263.c
浏览文件 @
30952237
...
...
@@ -87,7 +87,7 @@ static uint8_t uni_DCtab_chrom_len[512];
static
uint16_t
uni_DCtab_lum_bits
[
512
];
static
uint16_t
uni_DCtab_chrom_bits
[
512
];
static
uint
16
_t
(
*
mv_penalty
)[
MAX_MV
*
2
+
1
]
=
NULL
;
static
uint
8
_t
(
*
mv_penalty
)[
MAX_MV
*
2
+
1
]
=
NULL
;
static
uint8_t
fcode_tab
[
MAX_MV
*
2
+
1
];
static
uint8_t
umv_fcode_tab
[
MAX_MV
*
2
+
1
];
...
...
@@ -1255,7 +1255,7 @@ static void init_mv_penalty_and_fcode(MpegEncContext *s)
int
mv
;
if
(
mv_penalty
==
NULL
)
mv_penalty
=
av_mallocz
(
sizeof
(
uint
16
_t
)
*
(
MAX_FCODE
+
1
)
*
(
2
*
MAX_MV
+
1
)
);
mv_penalty
=
av_mallocz
(
sizeof
(
uint
8
_t
)
*
(
MAX_FCODE
+
1
)
*
(
2
*
MAX_MV
+
1
)
);
for
(
f_code
=
1
;
f_code
<=
MAX_FCODE
;
f_code
++
){
for
(
mv
=-
MAX_MV
;
mv
<=
MAX_MV
;
mv
++
){
...
...
libavcodec/motion_est.c
浏览文件 @
30952237
...
...
@@ -47,7 +47,7 @@ static inline int sad_hpel_motion_search(MpegEncContext * s,
int
*
mx_ptr
,
int
*
my_ptr
,
int
dmin
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
int
pred_x
,
int
pred_y
,
Picture
*
picture
,
int
n
,
int
size
,
uint
16
_t
*
const
mv_penalty
);
int
n
,
int
size
,
uint
8
_t
*
const
mv_penalty
);
static
inline
int
update_map_generation
(
MpegEncContext
*
s
)
{
...
...
@@ -657,7 +657,7 @@ static inline int sad_hpel_motion_search(MpegEncContext * s,
int
*
mx_ptr
,
int
*
my_ptr
,
int
dmin
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
int
pred_x
,
int
pred_y
,
Picture
*
picture
,
int
n
,
int
size
,
uint
16
_t
*
const
mv_penalty
)
int
n
,
int
size
,
uint
8
_t
*
const
mv_penalty
)
{
uint8_t
*
ref_picture
=
picture
->
data
[
0
];
uint32_t
*
score_map
=
s
->
me
.
score_map
;
...
...
@@ -831,7 +831,7 @@ static inline int h263_mv4_search(MpegEncContext *s, int xmin, int ymin, int xma
int
block
;
int
P
[
10
][
2
];
int
dmin_sum
=
0
,
mx4_sum
=
0
,
my4_sum
=
0
;
uint
16
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
s
->
f_code
]
+
MAX_MV
;
uint
8
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
s
->
f_code
]
+
MAX_MV
;
for
(
block
=
0
;
block
<
4
;
block
++
){
int
mx4
,
my4
;
...
...
@@ -982,7 +982,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
int
mb_type
=
0
;
uint8_t
*
ref_picture
=
s
->
last_picture
.
data
[
0
];
Picture
*
const
pic
=
&
s
->
current_picture
;
uint
16
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
s
->
f_code
]
+
MAX_MV
;
uint
8
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
s
->
f_code
]
+
MAX_MV
;
assert
(
s
->
quarter_sample
==
0
||
s
->
quarter_sample
==
1
);
...
...
@@ -1151,7 +1151,7 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s,
int
pred_x
=
0
,
pred_y
=
0
;
int
P
[
10
][
2
];
const
int
shift
=
1
+
s
->
quarter_sample
;
uint
16
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
s
->
f_code
]
+
MAX_MV
;
uint
8
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
s
->
f_code
]
+
MAX_MV
;
const
int
mv_stride
=
s
->
mb_width
+
2
;
const
int
xy
=
mb_x
+
1
+
(
mb_y
+
1
)
*
mv_stride
;
...
...
@@ -1213,7 +1213,7 @@ static int ff_estimate_motion_b(MpegEncContext * s,
const
int
mot_stride
=
s
->
mb_width
+
2
;
const
int
mot_xy
=
(
mb_y
+
1
)
*
mot_stride
+
mb_x
+
1
;
uint8_t
*
const
ref_picture
=
picture
->
data
[
0
];
uint
16
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
f_code
]
+
MAX_MV
;
uint
8
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
f_code
]
+
MAX_MV
;
int
mv_scale
;
s
->
me
.
penalty_factor
=
get_penalty_factor
(
s
,
s
->
avctx
->
me_cmp
);
...
...
@@ -1310,7 +1310,7 @@ static inline int check_bidir_mv(MpegEncContext * s,
//FIXME optimize?
//FIXME move into template?
//FIXME better f_code prediction (max mv & distance)
uint
16_t
*
mv_penalty
=
s
->
me
.
mv_penalty
[
s
->
f_code
]
+
MAX_MV
;
// f_code of the prev frame
uint
8_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
s
->
f_code
]
+
MAX_MV
;
// f_code of the prev frame
uint8_t
*
dest_y
=
s
->
me
.
scratchpad
;
uint8_t
*
ptr
;
int
dxy
;
...
...
@@ -1405,7 +1405,7 @@ static inline int direct_search(MpegEncContext * s,
const
int
time_pb
=
s
->
pb_time
;
int
mx
,
my
,
xmin
,
xmax
,
ymin
,
ymax
;
int16_t
(
*
mv_table
)[
2
]
=
s
->
b_direct_mv_table
;
uint
16
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
1
]
+
MAX_MV
;
uint
8
_t
*
const
mv_penalty
=
s
->
me
.
mv_penalty
[
1
]
+
MAX_MV
;
ymin
=
xmin
=
(
-
32
)
>>
shift
;
ymax
=
xmax
=
31
>>
shift
;
...
...
libavcodec/motion_est_template.c
浏览文件 @
30952237
...
...
@@ -72,7 +72,7 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int dmin,
int xmin, int ymin, int xmax, int ymax,
int pred_x, int pred_y, Picture *ref_picture,
int n, int size, uint
16
_t * const mv_penalty)
int n, int size, uint
8
_t * const mv_penalty)
{
const int xx = 16 * s->mb_x + 8*(n&1);
const int yy = 16 * s->mb_y + 8*(n>>1);
...
...
@@ -141,7 +141,7 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
int
*
mx_ptr
,
int
*
my_ptr
,
int
dmin
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
int
pred_x
,
int
pred_y
,
Picture
*
ref_picture
,
int
n
,
int
size
,
uint
16
_t
*
const
mv_penalty
)
int
n
,
int
size
,
uint
8
_t
*
const
mv_penalty
)
{
const
int
xx
=
16
*
s
->
mb_x
+
8
*
(
n
&
1
);
const
int
yy
=
16
*
s
->
mb_y
+
8
*
(
n
>>
1
);
...
...
@@ -246,7 +246,7 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
#endif
static
int
RENAME
(
hpel_get_mb_score
)(
MpegEncContext
*
s
,
int
mx
,
int
my
,
int
pred_x
,
int
pred_y
,
Picture
*
ref_picture
,
uint
16
_t
*
const
mv_penalty
)
uint
8
_t
*
const
mv_penalty
)
{
// const int check_luma= s->dsp.me_sub_cmp != s->dsp.mb_cmp;
const
int
size
=
0
;
...
...
@@ -295,7 +295,7 @@ static int RENAME(qpel_motion_search)(MpegEncContext * s,
int
*
mx_ptr
,
int
*
my_ptr
,
int
dmin
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
int
pred_x
,
int
pred_y
,
Picture
*
ref_picture
,
int
n
,
int
size
,
uint
16
_t
*
const
mv_penalty
)
int
n
,
int
size
,
uint
8
_t
*
const
mv_penalty
)
{
const
int
xx
=
16
*
s
->
mb_x
+
8
*
(
n
&
1
);
const
int
yy
=
16
*
s
->
mb_y
+
8
*
(
n
>>
1
);
...
...
@@ -513,7 +513,7 @@ static int RENAME(qpel_motion_search)(MpegEncContext * s,
}
static
int
RENAME
(
qpel_get_mb_score
)(
MpegEncContext
*
s
,
int
mx
,
int
my
,
int
pred_x
,
int
pred_y
,
Picture
*
ref_picture
,
uint
16
_t
*
const
mv_penalty
)
uint
8
_t
*
const
mv_penalty
)
{
const
int
size
=
0
;
const
int
xx
=
16
*
s
->
mb_x
;
...
...
@@ -598,7 +598,7 @@ static inline int RENAME(small_diamond_search)(MpegEncContext * s, int *best, in
Picture
*
ref_picture
,
int
const
pred_x
,
int
const
pred_y
,
int
const
penalty_factor
,
int
const
xmin
,
int
const
ymin
,
int
const
xmax
,
int
const
ymax
,
int
const
shift
,
uint32_t
*
map
,
int
map_generation
,
int
size
,
uint
16
_t
*
const
mv_penalty
uint32_t
*
map
,
int
map_generation
,
int
size
,
uint
8
_t
*
const
mv_penalty
)
{
me_cmp_func
cmp
,
chroma_cmp
;
...
...
@@ -640,7 +640,7 @@ static inline int RENAME(funny_diamond_search)(MpegEncContext * s, int *best, in
Picture
*
ref_picture
,
int
const
pred_x
,
int
const
pred_y
,
int
const
penalty_factor
,
int
const
xmin
,
int
const
ymin
,
int
const
xmax
,
int
const
ymax
,
int
const
shift
,
uint32_t
*
map
,
int
map_generation
,
int
size
,
uint
16
_t
*
const
mv_penalty
uint32_t
*
map
,
int
map_generation
,
int
size
,
uint
8
_t
*
const
mv_penalty
)
{
me_cmp_func
cmp
,
chroma_cmp
;
...
...
@@ -731,7 +731,7 @@ static inline int RENAME(sab_diamond_search)(MpegEncContext * s, int *best, int
Picture
*
ref_picture
,
int
const
pred_x
,
int
const
pred_y
,
int
const
penalty_factor
,
int
const
xmin
,
int
const
ymin
,
int
const
xmax
,
int
const
ymax
,
int
const
shift
,
uint32_t
*
map
,
int
map_generation
,
int
size
,
uint
16
_t
*
const
mv_penalty
uint32_t
*
map
,
int
map_generation
,
int
size
,
uint
8
_t
*
const
mv_penalty
)
{
me_cmp_func
cmp
,
chroma_cmp
;
...
...
@@ -811,7 +811,7 @@ static inline int RENAME(var_diamond_search)(MpegEncContext * s, int *best, int
Picture
*
ref_picture
,
int
const
pred_x
,
int
const
pred_y
,
int
const
penalty_factor
,
int
const
xmin
,
int
const
ymin
,
int
const
xmax
,
int
const
ymax
,
int
const
shift
,
uint32_t
*
map
,
int
map_generation
,
int
size
,
uint
16
_t
*
const
mv_penalty
uint32_t
*
map
,
int
map_generation
,
int
size
,
uint
8
_t
*
const
mv_penalty
)
{
me_cmp_func
cmp
,
chroma_cmp
;
...
...
@@ -888,7 +888,7 @@ static int RENAME(epzs_motion_search)(MpegEncContext * s, int block,
int
*
mx_ptr
,
int
*
my_ptr
,
int
P
[
10
][
2
],
int
pred_x
,
int
pred_y
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
Picture
*
ref_picture
,
int16_t
(
*
last_mv
)[
2
],
int
ref_mv_scale
,
uint
16
_t
*
const
mv_penalty
)
int
ref_mv_scale
,
uint
8
_t
*
const
mv_penalty
)
{
int
best
[
2
]
=
{
0
,
0
};
int
d
,
dmin
;
...
...
@@ -1000,7 +1000,7 @@ static int RENAME(epzs_motion_search4)(MpegEncContext * s, int block,
int
*
mx_ptr
,
int
*
my_ptr
,
int
P
[
10
][
2
],
int
pred_x
,
int
pred_y
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
Picture
*
ref_picture
,
int16_t
(
*
last_mv
)[
2
],
int
ref_mv_scale
,
uint
16
_t
*
const
mv_penalty
)
int
ref_mv_scale
,
uint
8
_t
*
const
mv_penalty
)
{
int
best
[
2
]
=
{
0
,
0
};
int
d
,
dmin
;
...
...
libavcodec/mpeg12.c
浏览文件 @
30952237
...
...
@@ -73,7 +73,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
static
int
mpeg_decode_motion
(
MpegEncContext
*
s
,
int
fcode
,
int
pred
);
#ifdef CONFIG_ENCODERS
static
uint
16_t
mv_penalty
[
MAX_FCODE
+
1
][
MAX_MV
*
2
+
1
]
;
static
uint
8_t
(
*
mv_penalty
)[
MAX_MV
*
2
+
1
]
=
NULL
;
static
uint8_t
fcode_tab
[
MAX_MV
*
2
+
1
];
static
uint32_t
uni_mpeg1_ac_vlc_bits
[
64
*
64
*
2
];
...
...
@@ -670,6 +670,8 @@ void ff_mpeg1_encode_init(MpegEncContext *s)
mpeg1_chr_dc_uni
[
i
+
255
]
=
bits
+
(
code
<<
8
);
}
mv_penalty
=
av_mallocz
(
sizeof
(
uint8_t
)
*
(
MAX_FCODE
+
1
)
*
(
2
*
MAX_MV
+
1
)
);
for
(
f_code
=
1
;
f_code
<=
MAX_FCODE
;
f_code
++
){
for
(
mv
=-
MAX_MV
;
mv
<=
MAX_MV
;
mv
++
){
int
len
;
...
...
libavcodec/mpegvideo.c
浏览文件 @
30952237
...
...
@@ -82,7 +82,7 @@ static const uint8_t h263_chroma_roundtab[16] = {
};
#ifdef CONFIG_ENCODERS
static
uint
16
_t
(
*
default_mv_penalty
)[
MAX_MV
*
2
+
1
]
=
NULL
;
static
uint
8
_t
(
*
default_mv_penalty
)[
MAX_MV
*
2
+
1
]
=
NULL
;
static
uint8_t
default_fcode_tab
[
MAX_MV
*
2
+
1
];
enum
PixelFormat
ff_yuv420p_list
[
2
]
=
{
PIX_FMT_YUV420P
,
-
1
};
...
...
@@ -680,8 +680,8 @@ int MPV_encode_init(AVCodecContext *avctx)
int
i
;
done
=
1
;
default_mv_penalty
=
av_mallocz
(
sizeof
(
uint
16
_t
)
*
(
MAX_FCODE
+
1
)
*
(
2
*
MAX_MV
+
1
)
);
memset
(
default_mv_penalty
,
0
,
sizeof
(
uint
16
_t
)
*
(
MAX_FCODE
+
1
)
*
(
2
*
MAX_MV
+
1
));
default_mv_penalty
=
av_mallocz
(
sizeof
(
uint
8
_t
)
*
(
MAX_FCODE
+
1
)
*
(
2
*
MAX_MV
+
1
)
);
memset
(
default_mv_penalty
,
0
,
sizeof
(
uint
8
_t
)
*
(
MAX_FCODE
+
1
)
*
(
2
*
MAX_MV
+
1
));
memset
(
default_fcode_tab
,
0
,
sizeof
(
uint8_t
)
*
(
2
*
MAX_MV
+
1
));
for
(
i
=-
16
;
i
<
16
;
i
++
){
...
...
libavcodec/mpegvideo.h
浏览文件 @
30952237
...
...
@@ -164,24 +164,24 @@ typedef struct MotionEstContext{
int
mb_penalty_factor
;
int
pre_pass
;
///< = 1 for the pre pass
int
dia_size
;
uint
16
_t
(
*
mv_penalty
)[
MAX_MV
*
2
+
1
];
///< amount of bits needed to encode a MV
uint
8
_t
(
*
mv_penalty
)[
MAX_MV
*
2
+
1
];
///< amount of bits needed to encode a MV
int
(
*
sub_motion_search
)(
struct
MpegEncContext
*
s
,
int
*
mx_ptr
,
int
*
my_ptr
,
int
dmin
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
int
pred_x
,
int
pred_y
,
Picture
*
ref_picture
,
int
n
,
int
size
,
uint
16
_t
*
const
mv_penalty
);
int
n
,
int
size
,
uint
8
_t
*
const
mv_penalty
);
int
(
*
motion_search
[
7
])(
struct
MpegEncContext
*
s
,
int
block
,
int
*
mx_ptr
,
int
*
my_ptr
,
int
P
[
10
][
2
],
int
pred_x
,
int
pred_y
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
Picture
*
ref_picture
,
int16_t
(
*
last_mv
)[
2
],
int
ref_mv_scale
,
uint
16
_t
*
const
mv_penalty
);
int
ref_mv_scale
,
uint
8
_t
*
const
mv_penalty
);
int
(
*
pre_motion_search
)(
struct
MpegEncContext
*
s
,
int
block
,
int
*
mx_ptr
,
int
*
my_ptr
,
int
P
[
10
][
2
],
int
pred_x
,
int
pred_y
,
int
xmin
,
int
ymin
,
int
xmax
,
int
ymax
,
Picture
*
ref_picture
,
int16_t
(
*
last_mv
)[
2
],
int
ref_mv_scale
,
uint
16
_t
*
const
mv_penalty
);
int
ref_mv_scale
,
uint
8
_t
*
const
mv_penalty
);
int
(
*
get_mb_score
)(
struct
MpegEncContext
*
s
,
int
mx
,
int
my
,
int
pred_x
,
int
pred_y
,
Picture
*
ref_picture
,
uint
16
_t
*
const
mv_penalty
);
uint
8
_t
*
const
mv_penalty
);
}
MotionEstContext
;
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录