Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
c097a32e
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 搜索 >>
提交
c097a32e
编写于
11月 17, 2018
作者:
M
Martin Vignali
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avcodec/proresdec : rename dsp part for 10b and check dspinit for supported bits per raw sample
based on patch by Kieran Kunhya
上级
a9709200
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
28 addition
and
18 deletion
+28
-18
libavcodec/proresdec2.c
libavcodec/proresdec2.c
+7
-2
libavcodec/proresdsp.c
libavcodec/proresdsp.c
+15
-10
libavcodec/proresdsp.h
libavcodec/proresdsp.h
+1
-3
libavcodec/simple_idct.c
libavcodec/simple_idct.c
+1
-1
libavcodec/simple_idct.h
libavcodec/simple_idct.h
+1
-1
libavcodec/tests/dct.c
libavcodec/tests/dct.c
+1
-1
libavcodec/x86/proresdsp_init.c
libavcodec/x86/proresdsp_init.c
+2
-0
未找到文件。
libavcodec/proresdec2.c
浏览文件 @
c097a32e
...
...
@@ -48,6 +48,7 @@ static void permute(uint8_t *dst, const uint8_t *src, const uint8_t permutation[
static
av_cold
int
decode_init
(
AVCodecContext
*
avctx
)
{
int
ret
=
0
;
ProresContext
*
ctx
=
avctx
->
priv_data
;
uint8_t
idct_permutation
[
64
];
...
...
@@ -78,7 +79,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
ff_blockdsp_init
(
&
ctx
->
bdsp
,
avctx
);
ff_proresdsp_init
(
&
ctx
->
prodsp
,
avctx
);
ret
=
ff_proresdsp_init
(
&
ctx
->
prodsp
,
avctx
);
if
(
ret
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Fail to init proresdsp for bits per raw sample %d
\n
"
,
avctx
->
bits_per_raw_sample
);
return
ret
;
}
ff_init_scantable_permutation
(
idct_permutation
,
ctx
->
prodsp
.
idct_permutation_type
);
...
...
@@ -86,7 +91,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
permute
(
ctx
->
progressive_scan
,
ff_prores_progressive_scan
,
idct_permutation
);
permute
(
ctx
->
interlaced_scan
,
ff_prores_interlaced_scan
,
idct_permutation
);
return
0
;
return
ret
;
}
static
int
decode_frame_header
(
ProresContext
*
ctx
,
const
uint8_t
*
buf
,
...
...
libavcodec/proresdsp.c
浏览文件 @
c097a32e
...
...
@@ -27,15 +27,15 @@
#include "proresdsp.h"
#include "simple_idct.h"
#define CLIP_MIN (1 <<
(PRORES_BITS_PER_SAMPLE - 8))
///< minimum value for clipping resulting pixels
#define CLIP_MAX
(1 << PRORES_BITS_PER_SAMPLE
) - CLIP_MIN - 1 ///< maximum value for clipping resulting pixels
#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
(x) (av_clip((x), CLIP_MIN, CLIP_MAX
))
#define CLIP
_10(x) (av_clip((x), CLIP_MIN, CLIP_MAX_10
))
/**
* Add bias value, clamp and output pixels of a slice
*/
static
void
put_pixels
(
uint16_t
*
dst
,
ptrdiff_t
linesize
,
const
int16_t
*
in
)
static
void
put_pixels
_10
(
uint16_t
*
dst
,
ptrdiff_t
linesize
,
const
int16_t
*
in
)
{
int
x
,
y
,
src_offset
,
dst_offset
;
...
...
@@ -43,25 +43,30 @@ static void put_pixels(uint16_t *dst, ptrdiff_t linesize, const int16_t *in)
for
(
x
=
0
;
x
<
8
;
x
++
)
{
src_offset
=
(
y
<<
3
)
+
x
;
dst
[
dst_offset
+
x
]
=
CLIP
(
in
[
src_offset
]);
dst
[
dst_offset
+
x
]
=
CLIP
_10
(
in
[
src_offset
]);
}
}
}
static
void
prores_idct_put_c
(
uint16_t
*
out
,
ptrdiff_t
linesize
,
int16_t
*
block
,
const
int16_t
*
qmat
)
static
void
prores_idct_put_
10_
c
(
uint16_t
*
out
,
ptrdiff_t
linesize
,
int16_t
*
block
,
const
int16_t
*
qmat
)
{
ff_prores_idct
(
block
,
qmat
);
put_pixels
(
out
,
linesize
>>
1
,
block
);
ff_prores_idct
_10
(
block
,
qmat
);
put_pixels
_10
(
out
,
linesize
>>
1
,
block
);
}
av_cold
void
ff_proresdsp_init
(
ProresDSPContext
*
dsp
,
AVCodecContext
*
avctx
)
av_cold
int
ff_proresdsp_init
(
ProresDSPContext
*
dsp
,
AVCodecContext
*
avctx
)
{
dsp
->
idct_put
=
prores_idct_put_c
;
if
(
avctx
->
bits_per_raw_sample
==
10
)
{
dsp
->
idct_put
=
prores_idct_put_10_c
;
dsp
->
idct_permutation_type
=
FF_IDCT_PERM_NONE
;
}
else
{
return
AVERROR_BUG
;
}
if
(
ARCH_X86
)
ff_proresdsp_init_x86
(
dsp
,
avctx
);
ff_init_scantable_permutation
(
dsp
->
idct_permutation
,
dsp
->
idct_permutation_type
);
return
0
;
}
libavcodec/proresdsp.h
浏览文件 @
c097a32e
...
...
@@ -27,15 +27,13 @@
#include <stdint.h>
#include "avcodec.h"
#define PRORES_BITS_PER_SAMPLE 10 ///< output precision of prores decoder
typedef
struct
ProresDSPContext
{
int
idct_permutation_type
;
uint8_t
idct_permutation
[
64
];
void
(
*
idct_put
)(
uint16_t
*
out
,
ptrdiff_t
linesize
,
int16_t
*
block
,
const
int16_t
*
qmat
);
}
ProresDSPContext
;
void
ff_proresdsp_init
(
ProresDSPContext
*
dsp
,
AVCodecContext
*
avctx
);
int
ff_proresdsp_init
(
ProresDSPContext
*
dsp
,
AVCodecContext
*
avctx
);
void
ff_proresdsp_init_x86
(
ProresDSPContext
*
dsp
,
AVCodecContext
*
avctx
);
...
...
libavcodec/simple_idct.c
浏览文件 @
c097a32e
...
...
@@ -236,7 +236,7 @@ void ff_simple_idct44_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
}
}
void
ff_prores_idct
(
int16_t
*
block
,
const
int16_t
*
qmat
)
void
ff_prores_idct
_10
(
int16_t
*
block
,
const
int16_t
*
qmat
)
{
int
i
;
...
...
libavcodec/simple_idct.h
浏览文件 @
c097a32e
...
...
@@ -52,7 +52,7 @@ void ff_simple_idct_int16_12bit(int16_t *block);
* and scales by a factor of 2 more between the two IDCTs to account
* for larger scale of input coefficients.
*/
void
ff_prores_idct
(
int16_t
*
block
,
const
int16_t
*
qmat
);
void
ff_prores_idct
_10
(
int16_t
*
block
,
const
int16_t
*
qmat
);
void
ff_simple_idct248_put
(
uint8_t
*
dest
,
ptrdiff_t
line_size
,
int16_t
*
block
);
...
...
libavcodec/tests/dct.c
浏览文件 @
c097a32e
...
...
@@ -73,7 +73,7 @@ static void ff_prores_idct_wrap(int16_t *dst){
for
(
i
=
0
;
i
<
64
;
i
++
){
qmat
[
i
]
=
4
;
}
ff_prores_idct
(
dst
,
qmat
);
ff_prores_idct
_10
(
dst
,
qmat
);
for
(
i
=
0
;
i
<
64
;
i
++
)
{
dst
[
i
]
-=
512
;
}
...
...
libavcodec/x86/proresdsp_init.c
浏览文件 @
c097a32e
...
...
@@ -35,6 +35,7 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
#if ARCH_X86_64
int
cpu_flags
=
av_get_cpu_flags
();
if
(
avctx
->
bits_per_raw_sample
==
10
){
if
(
EXTERNAL_SSE2
(
cpu_flags
))
{
dsp
->
idct_permutation_type
=
FF_IDCT_PERM_TRANSPOSE
;
dsp
->
idct_put
=
ff_prores_idct_put_10_sse2
;
...
...
@@ -44,5 +45,6 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
dsp
->
idct_permutation_type
=
FF_IDCT_PERM_TRANSPOSE
;
dsp
->
idct_put
=
ff_prores_idct_put_10_avx
;
}
}
#endif
/* ARCH_X86_64 */
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录