Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
6a583261
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,体验更适合开发者的 AI 搜索 >>
提交
6a583261
编写于
11月 17, 2018
作者:
M
Martin Vignali
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avcodec/proresdec : add 12b prores idct
based on patch by Kieran Kunhya
上级
fddc92d4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
45 addition
and
3 deletion
+45
-3
libavcodec/proresdsp.c
libavcodec/proresdsp.c
+28
-3
libavcodec/simple_idct.c
libavcodec/simple_idct.c
+16
-0
libavcodec/simple_idct.h
libavcodec/simple_idct.h
+1
-0
未找到文件。
libavcodec/proresdsp.c
浏览文件 @
6a583261
...
...
@@ -29,36 +29,61 @@
#define CLIP_MIN (1 << 2) ///< minimum value for clipping resulting pixels
#define CLIP_MAX_10 (1 << 10) - CLIP_MIN - 1 ///< maximum value for clipping resulting pixels
#define CLIP_MAX_12 (1 << 12) - CLIP_MIN - 1 ///< maximum value for clipping resulting pixels
#define CLIP_10(x) (av_clip((x), CLIP_MIN, CLIP_MAX_10))
#define CLIP_12(x) (av_clip((x), CLIP_MIN, CLIP_MAX_12))
/**
* Add bias value, clamp and output pixels of a slice
*/
static
void
put_pixels_10
(
uint16_t
*
dst
,
ptrdiff_t
linesize
,
const
int16_t
*
in
)
{
static
inline
void
put_pixel
(
uint16_t
*
dst
,
ptrdiff_t
linesize
,
const
int16_t
*
in
,
int
bits_per_raw_sample
)
{
int
x
,
y
,
src_offset
,
dst_offset
;
for
(
y
=
0
,
dst_offset
=
0
;
y
<
8
;
y
++
,
dst_offset
+=
linesize
)
{
for
(
x
=
0
;
x
<
8
;
x
++
)
{
src_offset
=
(
y
<<
3
)
+
x
;
dst
[
dst_offset
+
x
]
=
CLIP_10
(
in
[
src_offset
]);
if
(
bits_per_raw_sample
==
10
)
{
dst
[
dst_offset
+
x
]
=
CLIP_10
(
in
[
src_offset
]);
}
else
{
//12b
dst
[
dst_offset
+
x
]
=
CLIP_12
(
in
[
src_offset
]);
}
}
}
}
static
void
put_pixels_10
(
uint16_t
*
dst
,
ptrdiff_t
linesize
,
const
int16_t
*
in
)
{
put_pixel
(
dst
,
linesize
,
in
,
10
);
}
static
void
put_pixels_12
(
uint16_t
*
dst
,
ptrdiff_t
linesize
,
const
int16_t
*
in
)
{
put_pixel
(
dst
,
linesize
,
in
,
12
);
}
static
void
prores_idct_put_10_c
(
uint16_t
*
out
,
ptrdiff_t
linesize
,
int16_t
*
block
,
const
int16_t
*
qmat
)
{
ff_prores_idct_10
(
block
,
qmat
);
put_pixels_10
(
out
,
linesize
>>
1
,
block
);
}
static
void
prores_idct_put_12_c
(
uint16_t
*
out
,
ptrdiff_t
linesize
,
int16_t
*
block
,
const
int16_t
*
qmat
)
{
ff_prores_idct_12
(
block
,
qmat
);
put_pixels_12
(
out
,
linesize
>>
1
,
block
);
}
av_cold
int
ff_proresdsp_init
(
ProresDSPContext
*
dsp
,
AVCodecContext
*
avctx
)
{
if
(
avctx
->
bits_per_raw_sample
==
10
)
{
dsp
->
idct_put
=
prores_idct_put_10_c
;
dsp
->
idct_permutation_type
=
FF_IDCT_PERM_NONE
;
}
else
if
(
avctx
->
bits_per_raw_sample
==
12
)
{
dsp
->
idct_put
=
prores_idct_put_12_c
;
dsp
->
idct_permutation_type
=
FF_IDCT_PERM_NONE
;
}
else
{
return
AVERROR_BUG
;
}
...
...
libavcodec/simple_idct.c
浏览文件 @
6a583261
...
...
@@ -251,3 +251,19 @@ void ff_prores_idct_10(int16_t *block, const int16_t *qmat)
idctSparseCol_extrashift_10
(
block
+
i
);
}
}
void
ff_prores_idct_12
(
int16_t
*
block
,
const
int16_t
*
qmat
)
{
int
i
;
for
(
i
=
0
;
i
<
64
;
i
++
)
block
[
i
]
*=
qmat
[
i
];
for
(
i
=
0
;
i
<
8
;
i
++
)
idctRowCondDC_int16_12bit
(
block
+
i
*
8
,
0
);
for
(
i
=
0
;
i
<
8
;
i
++
)
{
block
[
i
]
+=
8192
;
idctSparseCol_int16_12bit
(
block
+
i
);
}
}
libavcodec/simple_idct.h
浏览文件 @
6a583261
...
...
@@ -53,6 +53,7 @@ void ff_simple_idct_int16_12bit(int16_t *block);
* for larger scale of input coefficients.
*/
void
ff_prores_idct_10
(
int16_t
*
block
,
const
int16_t
*
qmat
);
void
ff_prores_idct_12
(
int16_t
*
block
,
const
int16_t
*
qmat
);
void
ff_simple_idct248_put
(
uint8_t
*
dest
,
ptrdiff_t
line_size
,
int16_t
*
block
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录