Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
9971331d
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,发现更多精彩内容 >>
提交
9971331d
编写于
10月 04, 2008
作者:
D
David Conrad
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move VP3 loop filter to DSPContext
Originally committed as revision 15551 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
0d696d34
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
46 addition
and
43 deletion
+46
-43
libavcodec/dsputil.c
libavcodec/dsputil.c
+5
-0
libavcodec/dsputil.h
libavcodec/dsputil.h
+6
-0
libavcodec/vp3.c
libavcodec/vp3.c
+4
-43
libavcodec/vp3dsp.c
libavcodec/vp3dsp.c
+31
-0
未找到文件。
libavcodec/dsputil.c
浏览文件 @
9971331d
...
...
@@ -4471,6 +4471,11 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c
->
h263_v_loop_filter
=
h263_v_loop_filter_c
;
}
if
(
ENABLE_VP3_DECODER
||
ENABLE_THEORA_DECODER
)
{
c
->
vp3_h_loop_filter
=
ff_vp3_h_loop_filter_c
;
c
->
vp3_v_loop_filter
=
ff_vp3_v_loop_filter_c
;
}
c
->
h261_loop_filter
=
h261_loop_filter_c
;
c
->
try_8x8basis
=
try_8x8basis_c
;
...
...
libavcodec/dsputil.h
浏览文件 @
9971331d
...
...
@@ -86,6 +86,9 @@ void ff_vp3_idct_c(DCTELEM *block/* align 16*/);
void
ff_vp3_idct_put_c
(
uint8_t
*
dest
/*align 8*/
,
int
line_size
,
DCTELEM
*
block
/*align 16*/
);
void
ff_vp3_idct_add_c
(
uint8_t
*
dest
/*align 8*/
,
int
line_size
,
DCTELEM
*
block
/*align 16*/
);
void
ff_vp3_v_loop_filter_c
(
uint8_t
*
src
,
int
stride
,
int
*
bounding_values
);
void
ff_vp3_h_loop_filter_c
(
uint8_t
*
src
,
int
stride
,
int
*
bounding_values
);
/* 1/2^n downscaling functions from imgconvert.c */
void
ff_img_copy_plane
(
uint8_t
*
dst
,
int
dst_wrap
,
const
uint8_t
*
src
,
int
src_wrap
,
int
width
,
int
height
);
void
ff_shrink22
(
uint8_t
*
dst
,
int
dst_wrap
,
const
uint8_t
*
src
,
int
src_wrap
,
int
width
,
int
height
);
...
...
@@ -359,6 +362,9 @@ typedef struct DSPContext {
void
(
*
x8_v_loop_filter
)(
uint8_t
*
src
,
int
stride
,
int
qscale
);
void
(
*
x8_h_loop_filter
)(
uint8_t
*
src
,
int
stride
,
int
qscale
);
void
(
*
vp3_v_loop_filter
)(
uint8_t
*
src
,
int
stride
,
int
*
bounding_values
);
void
(
*
vp3_h_loop_filter
)(
uint8_t
*
src
,
int
stride
,
int
*
bounding_values
);
/* assume len is a multiple of 4, and arrays are 16-byte aligned */
void
(
*
vorbis_inverse_coupling
)(
float
*
mag
,
float
*
ang
,
int
blocksize
);
void
(
*
ac3_downmix
)(
float
(
*
samples
)[
256
],
float
(
*
matrix
)[
2
],
int
out_ch
,
int
in_ch
,
int
len
);
...
...
libavcodec/vp3.c
浏览文件 @
9971331d
...
...
@@ -1283,12 +1283,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
}
}
static
void
horizontal_filter
(
unsigned
char
*
first_pixel
,
int
stride
,
int
*
bounding_values
);
static
void
vertical_filter
(
unsigned
char
*
first_pixel
,
int
stride
,
int
*
bounding_values
);
/*
* Perform the final rendering for a particular slice of data.
* The slice number ranges from 0..(macroblock_height - 1).
...
...
@@ -1495,39 +1489,6 @@ static void render_slice(Vp3DecodeContext *s, int slice)
emms_c
();
}
static
void
horizontal_filter
(
unsigned
char
*
first_pixel
,
int
stride
,
int
*
bounding_values
)
{
unsigned
char
*
end
;
int
filter_value
;
for
(
end
=
first_pixel
+
8
*
stride
;
first_pixel
!=
end
;
first_pixel
+=
stride
)
{
filter_value
=
(
first_pixel
[
-
2
]
-
first_pixel
[
1
])
+
3
*
(
first_pixel
[
0
]
-
first_pixel
[
-
1
]);
filter_value
=
bounding_values
[(
filter_value
+
4
)
>>
3
];
first_pixel
[
-
1
]
=
av_clip_uint8
(
first_pixel
[
-
1
]
+
filter_value
);
first_pixel
[
0
]
=
av_clip_uint8
(
first_pixel
[
0
]
-
filter_value
);
}
}
static
void
vertical_filter
(
unsigned
char
*
first_pixel
,
int
stride
,
int
*
bounding_values
)
{
unsigned
char
*
end
;
int
filter_value
;
const
int
nstride
=
-
stride
;
for
(
end
=
first_pixel
+
8
;
first_pixel
<
end
;
first_pixel
++
)
{
filter_value
=
(
first_pixel
[
2
*
nstride
]
-
first_pixel
[
stride
])
+
3
*
(
first_pixel
[
0
]
-
first_pixel
[
nstride
]);
filter_value
=
bounding_values
[(
filter_value
+
4
)
>>
3
];
first_pixel
[
nstride
]
=
av_clip_uint8
(
first_pixel
[
nstride
]
+
filter_value
);
first_pixel
[
0
]
=
av_clip_uint8
(
first_pixel
[
0
]
-
filter_value
);
}
}
static
void
apply_loop_filter
(
Vp3DecodeContext
*
s
)
{
int
plane
;
...
...
@@ -1569,7 +1530,7 @@ static void apply_loop_filter(Vp3DecodeContext *s)
/* do not perform left edge filter for left columns frags */
if
((
x
>
0
)
&&
(
s
->
all_fragments
[
fragment
].
coding_method
!=
MODE_COPY
))
{
horizontal
_filter
(
s
->
dsp
.
vp3_h_loop
_filter
(
plane_data
+
s
->
all_fragments
[
fragment
].
first_pixel
,
stride
,
bounding_values
);
}
...
...
@@ -1577,7 +1538,7 @@ static void apply_loop_filter(Vp3DecodeContext *s)
/* do not perform top edge filter for top row fragments */
if
((
y
>
0
)
&&
(
s
->
all_fragments
[
fragment
].
coding_method
!=
MODE_COPY
))
{
vertical
_filter
(
s
->
dsp
.
vp3_v_loop
_filter
(
plane_data
+
s
->
all_fragments
[
fragment
].
first_pixel
,
stride
,
bounding_values
);
}
...
...
@@ -1588,7 +1549,7 @@ static void apply_loop_filter(Vp3DecodeContext *s)
if
((
x
<
width
-
1
)
&&
(
s
->
all_fragments
[
fragment
].
coding_method
!=
MODE_COPY
)
&&
(
s
->
all_fragments
[
fragment
+
1
].
coding_method
==
MODE_COPY
))
{
horizontal
_filter
(
s
->
dsp
.
vp3_h_loop
_filter
(
plane_data
+
s
->
all_fragments
[
fragment
+
1
].
first_pixel
,
stride
,
bounding_values
);
}
...
...
@@ -1599,7 +1560,7 @@ static void apply_loop_filter(Vp3DecodeContext *s)
if
((
y
<
height
-
1
)
&&
(
s
->
all_fragments
[
fragment
].
coding_method
!=
MODE_COPY
)
&&
(
s
->
all_fragments
[
fragment
+
width
].
coding_method
==
MODE_COPY
))
{
vertical
_filter
(
s
->
dsp
.
vp3_v_loop
_filter
(
plane_data
+
s
->
all_fragments
[
fragment
+
width
].
first_pixel
,
stride
,
bounding_values
);
}
...
...
libavcodec/vp3dsp.c
浏览文件 @
9971331d
...
...
@@ -222,3 +222,34 @@ void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*
void
ff_vp3_idct_add_c
(
uint8_t
*
dest
/*align 8*/
,
int
line_size
,
DCTELEM
*
block
/*align 16*/
){
idct
(
dest
,
line_size
,
block
,
2
);
}
void
ff_vp3_v_loop_filter_c
(
uint8_t
*
first_pixel
,
int
stride
,
int
*
bounding_values
)
{
unsigned
char
*
end
;
int
filter_value
;
const
int
nstride
=
-
stride
;
for
(
end
=
first_pixel
+
8
;
first_pixel
<
end
;
first_pixel
++
)
{
filter_value
=
(
first_pixel
[
2
*
nstride
]
-
first_pixel
[
stride
])
+
3
*
(
first_pixel
[
0
]
-
first_pixel
[
nstride
]);
filter_value
=
bounding_values
[(
filter_value
+
4
)
>>
3
];
first_pixel
[
nstride
]
=
av_clip_uint8
(
first_pixel
[
nstride
]
+
filter_value
);
first_pixel
[
0
]
=
av_clip_uint8
(
first_pixel
[
0
]
-
filter_value
);
}
}
void
ff_vp3_h_loop_filter_c
(
uint8_t
*
first_pixel
,
int
stride
,
int
*
bounding_values
)
{
unsigned
char
*
end
;
int
filter_value
;
for
(
end
=
first_pixel
+
8
*
stride
;
first_pixel
!=
end
;
first_pixel
+=
stride
)
{
filter_value
=
(
first_pixel
[
-
2
]
-
first_pixel
[
1
])
+
3
*
(
first_pixel
[
0
]
-
first_pixel
[
-
1
]);
filter_value
=
bounding_values
[(
filter_value
+
4
)
>>
3
];
first_pixel
[
-
1
]
=
av_clip_uint8
(
first_pixel
[
-
1
]
+
filter_value
);
first_pixel
[
0
]
=
av_clip_uint8
(
first_pixel
[
0
]
-
filter_value
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录