Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
772225c0
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,发现更多精彩内容 >>
提交
772225c0
编写于
1月 20, 2011
作者:
R
Ronald S. Bultje
提交者:
Michael Niedermayer
1月 21, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert
2a1f431d
, it broke H264 lossless.
(cherry picked from commit
66c6b5e2
)
上级
2293b0b6
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
99 addition
and
42 deletion
+99
-42
libavcodec/dsputil.h
libavcodec/dsputil.h
+0
-1
libavcodec/h264.c
libavcodec/h264.c
+91
-6
libavcodec/h264.h
libavcodec/h264.h
+0
-1
libavcodec/h264_cabac.c
libavcodec/h264_cabac.c
+1
-2
libavcodec/h264_cavlc.c
libavcodec/h264_cavlc.c
+1
-2
libavcodec/h264data.h
libavcodec/h264data.h
+2
-1
libavcodec/h264dsp.c
libavcodec/h264dsp.c
+0
-1
libavcodec/h264dsp.h
libavcodec/h264dsp.h
+0
-1
libavcodec/h264idct.c
libavcodec/h264idct.c
+0
-22
libavcodec/svq3.c
libavcodec/svq3.c
+4
-5
未找到文件。
libavcodec/dsputil.h
浏览文件 @
772225c0
...
...
@@ -66,7 +66,6 @@ void ff_h264_idct_add8_c(uint8_t **dest, const int *blockoffset, DCTELEM *block,
void
ff_h264_luma_dc_dequant_idct_c
(
DCTELEM
*
output
,
DCTELEM
*
input
,
int
qmul
);
void
ff_svq3_luma_dc_dequant_idct_c
(
DCTELEM
*
output
,
DCTELEM
*
input
,
int
qp
);
void
ff_chroma_dc_dequant_idct_c
(
DCTELEM
*
output
,
DCTELEM
*
input
,
int
qmul
);
void
ff_svq3_add_idct_c
(
uint8_t
*
dst
,
DCTELEM
*
block
,
int
stride
,
int
qp
,
int
dc
);
void
ff_vector_fmul_window_c
(
float
*
dst
,
const
float
*
src0
,
const
float
*
src1
,
...
...
libavcodec/h264.c
浏览文件 @
772225c0
...
...
@@ -246,6 +246,93 @@ int ff_h264_decode_rbsp_trailing(H264Context *h, const uint8_t *src){
return
0
;
}
#if 0
/**
* DCT transforms the 16 dc values.
* @param qp quantization parameter ??? FIXME
*/
static void h264_luma_dc_dct_c(DCTELEM *block/*, int qp*/){
// const int qmul= dequant_coeff[qp][0];
int i;
int temp[16]; //FIXME check if this is a good idea
static const int x_offset[4]={0, 1*stride, 4* stride, 5*stride};
static const int y_offset[4]={0, 2*stride, 8* stride, 10*stride};
for(i=0; i<4; i++){
const int offset= y_offset[i];
const int z0= block[offset+stride*0] + block[offset+stride*4];
const int z1= block[offset+stride*0] - block[offset+stride*4];
const int z2= block[offset+stride*1] - block[offset+stride*5];
const int z3= block[offset+stride*1] + block[offset+stride*5];
temp[4*i+0]= z0+z3;
temp[4*i+1]= z1+z2;
temp[4*i+2]= z1-z2;
temp[4*i+3]= z0-z3;
}
for(i=0; i<4; i++){
const int offset= x_offset[i];
const int z0= temp[4*0+i] + temp[4*2+i];
const int z1= temp[4*0+i] - temp[4*2+i];
const int z2= temp[4*1+i] - temp[4*3+i];
const int z3= temp[4*1+i] + temp[4*3+i];
block[stride*0 +offset]= (z0 + z3)>>1;
block[stride*2 +offset]= (z1 + z2)>>1;
block[stride*8 +offset]= (z1 - z2)>>1;
block[stride*10+offset]= (z0 - z3)>>1;
}
}
#endif
#undef xStride
#undef stride
static
void
chroma_dc_dequant_idct_c
(
DCTELEM
*
block
,
int
qmul
){
const
int
stride
=
16
*
2
;
const
int
xStride
=
16
;
int
a
,
b
,
c
,
d
,
e
;
a
=
block
[
stride
*
0
+
xStride
*
0
];
b
=
block
[
stride
*
0
+
xStride
*
1
];
c
=
block
[
stride
*
1
+
xStride
*
0
];
d
=
block
[
stride
*
1
+
xStride
*
1
];
e
=
a
-
b
;
a
=
a
+
b
;
b
=
c
-
d
;
c
=
c
+
d
;
block
[
stride
*
0
+
xStride
*
0
]
=
((
a
+
c
)
*
qmul
)
>>
7
;
block
[
stride
*
0
+
xStride
*
1
]
=
((
e
+
b
)
*
qmul
)
>>
7
;
block
[
stride
*
1
+
xStride
*
0
]
=
((
a
-
c
)
*
qmul
)
>>
7
;
block
[
stride
*
1
+
xStride
*
1
]
=
((
e
-
b
)
*
qmul
)
>>
7
;
}
#if 0
static void chroma_dc_dct_c(DCTELEM *block){
const int stride= 16*2;
const int xStride= 16;
int a,b,c,d,e;
a= block[stride*0 + xStride*0];
b= block[stride*0 + xStride*1];
c= block[stride*1 + xStride*0];
d= block[stride*1 + xStride*1];
e= a-b;
a= a+b;
b= c-d;
c= c+d;
block[stride*0 + xStride*0]= (a+c);
block[stride*0 + xStride*1]= (e+b);
block[stride*1 + xStride*0]= (a-c);
block[stride*1 + xStride*1]= (e-b);
}
#endif
static
inline
void
mc_dir_part
(
H264Context
*
h
,
Picture
*
pic
,
int
n
,
int
square
,
int
chroma_height
,
int
delta
,
int
list
,
uint8_t
*
dest_y
,
uint8_t
*
dest_cb
,
uint8_t
*
dest_cr
,
int
src_x_offset
,
int
src_y_offset
,
...
...
@@ -1196,19 +1283,17 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple){
}
}
}
else
{
int
chroma_qpu
=
h
->
dequant4_coeff
[
IS_INTRA
(
mb_type
)
?
1
:
4
][
h
->
chroma_qp
[
0
]][
0
];
int
chroma_qpv
=
h
->
dequant4_coeff
[
IS_INTRA
(
mb_type
)
?
2
:
5
][
h
->
chroma_qp
[
1
]][
0
];
if
(
is_h264
){
if
(
h
->
non_zero_count_cache
[
scan8
[
CHROMA_DC_BLOCK_INDEX
+
0
]
])
h
->
h264dsp
.
h264_chroma_dc_dequant_idct
(
h
->
mb
+
16
*
16
+
0
*
16
,
&
h
->
mb_chroma_dc
[
0
],
chroma_qpu
);
chroma_dc_dequant_idct_c
(
h
->
mb
+
16
*
16
,
h
->
dequant4_coeff
[
IS_INTRA
(
mb_type
)
?
1
:
4
][
h
->
chroma_qp
[
0
]][
0
]
);
if
(
h
->
non_zero_count_cache
[
scan8
[
CHROMA_DC_BLOCK_INDEX
+
1
]
])
h
->
h264dsp
.
h264_chroma_dc_dequant_idct
(
h
->
mb
+
16
*
16
+
4
*
16
,
&
h
->
mb_chroma_dc
[
1
],
chroma_qpv
);
chroma_dc_dequant_idct_c
(
h
->
mb
+
16
*
16
+
4
*
16
,
h
->
dequant4_coeff
[
IS_INTRA
(
mb_type
)
?
2
:
5
][
h
->
chroma_qp
[
1
]][
0
]
);
h
->
h264dsp
.
h264_idct_add8
(
dest
,
block_offset
,
h
->
mb
,
uvlinesize
,
h
->
non_zero_count_cache
);
}
else
{
h
->
h264dsp
.
h264_chroma_dc_dequant_idct
(
h
->
mb
+
16
*
16
+
0
*
16
,
&
h
->
mb_chroma_dc
[
0
],
chroma_qpu
);
h
->
h264dsp
.
h264_chroma_dc_dequant_idct
(
h
->
mb
+
16
*
16
+
4
*
16
,
&
h
->
mb_chroma_dc
[
1
],
chroma_qpv
);
chroma_dc_dequant_idct_c
(
h
->
mb
+
16
*
16
,
h
->
dequant4_coeff
[
IS_INTRA
(
mb_type
)
?
1
:
4
][
h
->
chroma_qp
[
0
]][
0
]
);
chroma_dc_dequant_idct_c
(
h
->
mb
+
16
*
16
+
4
*
16
,
h
->
dequant4_coeff
[
IS_INTRA
(
mb_type
)
?
2
:
5
][
h
->
chroma_qp
[
1
]][
0
]
);
for
(
i
=
16
;
i
<
16
+
8
;
i
++
){
if
(
h
->
non_zero_count_cache
[
scan8
[
i
]
]
||
h
->
mb
[
i
*
16
]){
uint8_t
*
const
ptr
=
dest
[(
i
&
4
)
>>
2
]
+
block_offset
[
i
];
...
...
libavcodec/h264.h
浏览文件 @
772225c0
...
...
@@ -407,7 +407,6 @@ typedef struct H264Context{
DECLARE_ALIGNED
(
16
,
DCTELEM
,
mb
)[
16
*
24
];
DECLARE_ALIGNED
(
16
,
DCTELEM
,
mb_luma_dc
)[
16
];
DECLARE_ALIGNED
(
16
,
DCTELEM
,
mb_chroma_dc
)[
2
][
4
];
DCTELEM
mb_padding
[
256
];
///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb
/**
...
...
libavcodec/h264_cabac.c
浏览文件 @
772225c0
...
...
@@ -1687,10 +1687,9 @@ decode_intra_mb:
if
(
cbp
&
0x30
){
int
c
;
AV_ZERO128
(
h
->
mb_chroma_dc
);
for
(
c
=
0
;
c
<
2
;
c
++
)
{
//av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-DC\n",c );
decode_cabac_residual_dc
(
h
,
h
->
mb
_chroma_dc
[
c
]
,
3
,
CHROMA_DC_BLOCK_INDEX
+
c
,
chroma_dc_scan
,
4
);
decode_cabac_residual_dc
(
h
,
h
->
mb
+
256
+
16
*
4
*
c
,
3
,
CHROMA_DC_BLOCK_INDEX
+
c
,
chroma_dc_scan
,
4
);
}
}
...
...
libavcodec/h264_cavlc.c
浏览文件 @
772225c0
...
...
@@ -987,9 +987,8 @@ decode_intra_mb:
}
if
(
cbp
&
0x30
){
AV_ZERO128
(
h
->
mb_chroma_dc
);
for
(
chroma_idx
=
0
;
chroma_idx
<
2
;
chroma_idx
++
)
if
(
decode_residual
(
h
,
gb
,
h
->
mb
_chroma_dc
[
chroma_idx
]
,
CHROMA_DC_BLOCK_INDEX
+
chroma_idx
,
chroma_dc_scan
,
NULL
,
4
)
<
0
){
if
(
decode_residual
(
h
,
gb
,
h
->
mb
+
256
+
16
*
4
*
chroma_idx
,
CHROMA_DC_BLOCK_INDEX
+
chroma_idx
,
chroma_dc_scan
,
NULL
,
4
)
<
0
){
return
-
1
;
}
}
...
...
libavcodec/h264data.h
浏览文件 @
772225c0
...
...
@@ -79,7 +79,8 @@ static const uint8_t luma_dc_field_scan[16]={
};
static
const
uint8_t
chroma_dc_scan
[
4
]
=
{
0
,
1
,
2
,
3
(
0
+
0
*
2
)
*
16
,
(
1
+
0
*
2
)
*
16
,
(
0
+
1
*
2
)
*
16
,
(
1
+
1
*
2
)
*
16
,
//FIXME
};
// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
...
...
libavcodec/h264dsp.c
浏览文件 @
772225c0
...
...
@@ -283,7 +283,6 @@ void ff_h264dsp_init(H264DSPContext *c)
c
->
h264_idct_add8
=
ff_h264_idct_add8_c
;
c
->
h264_idct_add16intra
=
ff_h264_idct_add16intra_c
;
c
->
h264_luma_dc_dequant_idct
=
ff_h264_luma_dc_dequant_idct_c
;
c
->
h264_chroma_dc_dequant_idct
=
ff_chroma_dc_dequant_idct_c
;
c
->
weight_h264_pixels_tab
[
0
]
=
weight_h264_pixels16x16_c
;
c
->
weight_h264_pixels_tab
[
1
]
=
weight_h264_pixels16x8_c
;
...
...
libavcodec/h264dsp.h
浏览文件 @
772225c0
...
...
@@ -68,7 +68,6 @@ typedef struct H264DSPContext{
void
(
*
h264_idct_add8
)(
uint8_t
**
dst
/*align 16*/
,
const
int
*
blockoffset
,
DCTELEM
*
block
/*align 16*/
,
int
stride
,
const
uint8_t
nnzc
[
6
*
8
]);
void
(
*
h264_idct_add16intra
)(
uint8_t
*
dst
/*align 16*/
,
const
int
*
blockoffset
,
DCTELEM
*
block
/*align 16*/
,
int
stride
,
const
uint8_t
nnzc
[
6
*
8
]);
void
(
*
h264_luma_dc_dequant_idct
)(
DCTELEM
*
output
,
DCTELEM
*
input
/*align 16*/
,
int
qmul
);
void
(
*
h264_chroma_dc_dequant_idct
)(
DCTELEM
*
output
,
DCTELEM
*
input
/*align 16*/
,
int
qmul
);
}
H264DSPContext
;
void
ff_h264dsp_init
(
H264DSPContext
*
c
);
...
...
libavcodec/h264idct.c
浏览文件 @
772225c0
...
...
@@ -250,26 +250,4 @@ void ff_h264_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qmul){
output
[
stride
*
4
+
offset
]
=
((((
z1
-
z2
)
*
qmul
+
128
)
>>
8
));
output
[
stride
*
5
+
offset
]
=
((((
z0
-
z3
)
*
qmul
+
128
)
>>
8
));
}
#undef stride
}
void
ff_chroma_dc_dequant_idct_c
(
DCTELEM
*
output
,
DCTELEM
*
input
,
int
qmul
){
const
int
stride
=
16
*
2
;
const
int
xStride
=
16
;
int
a
,
b
,
c
,
d
,
e
;
a
=
input
[
0
];
b
=
input
[
1
];
c
=
input
[
2
];
d
=
input
[
3
];
e
=
a
-
b
;
a
=
a
+
b
;
b
=
c
-
d
;
c
=
c
+
d
;
output
[
stride
*
0
+
xStride
*
0
]
=
((
a
+
c
)
*
qmul
)
>>
7
;
output
[
stride
*
0
+
xStride
*
1
]
=
((
e
+
b
)
*
qmul
)
>>
7
;
output
[
stride
*
1
+
xStride
*
0
]
=
((
a
-
c
)
*
qmul
)
>>
7
;
output
[
stride
*
1
+
xStride
*
1
]
=
((
e
-
b
)
*
qmul
)
>>
7
;
}
libavcodec/svq3.c
浏览文件 @
772225c0
...
...
@@ -671,12 +671,11 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type)
}
if
((
cbp
&
0x30
))
{
AV_ZERO128
(
h
->
mb_chroma_dc
);
for
(
i
=
0
;
i
<
2
;
++
i
)
{
if
(
svq3_decode_block
(
&
s
->
gb
,
h
->
mb_chroma_dc
[
i
],
0
,
3
)){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"error while decoding chroma dc block
\n
"
);
return
-
1
;
}
if
(
svq3_decode_block
(
&
s
->
gb
,
&
h
->
mb
[
16
*
(
16
+
4
*
i
)
],
0
,
3
)){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"error while decoding chroma dc block
\n
"
);
return
-
1
;
}
}
if
((
cbp
&
0x20
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录