Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
1deb66c5
Commit
1deb66c5
authored
Oct 21, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: move get_b_cbp() from h263.h to mpeg4videoenc.c
It's not used anywhere else.
parent
3fc08304
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
42 deletions
+40
-42
h263.h
libavcodec/h263.h
+0
-42
mpeg4videoenc.c
libavcodec/mpeg4videoenc.c
+40
-0
No files found.
libavcodec/h263.h
View file @
1deb66c5
...
...
@@ -200,48 +200,6 @@ static inline int get_p_cbp(MpegEncContext * s,
return
cbp
;
}
static
inline
int
get_b_cbp
(
MpegEncContext
*
s
,
DCTELEM
block
[
6
][
64
],
int
motion_x
,
int
motion_y
,
int
mb_type
){
int
cbp
=
0
,
i
;
if
(
s
->
flags
&
CODEC_FLAG_CBP_RD
){
int
score
=
0
;
const
int
lambda
=
s
->
lambda2
>>
(
FF_LAMBDA_SHIFT
-
6
);
for
(
i
=
0
;
i
<
6
;
i
++
){
if
(
s
->
coded_score
[
i
]
<
0
){
score
+=
s
->
coded_score
[
i
];
cbp
|=
1
<<
(
5
-
i
);
}
}
if
(
cbp
){
int
zero_score
=
-
6
;
if
((
motion_x
|
motion_y
|
s
->
dquant
|
mb_type
)
==
0
){
zero_score
-=
4
;
//2*MV + mb_type + cbp bit
}
zero_score
*=
lambda
;
if
(
zero_score
<=
score
){
cbp
=
0
;
}
}
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
(
s
->
block_last_index
[
i
]
>=
0
&&
((
cbp
>>
(
5
-
i
))
&
1
)
==
0
){
s
->
block_last_index
[
i
]
=
-
1
;
s
->
dsp
.
clear_block
(
s
->
block
[
i
]);
}
}
}
else
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
(
s
->
block_last_index
[
i
]
>=
0
)
cbp
|=
1
<<
(
5
-
i
);
}
}
return
cbp
;
}
static
inline
void
memsetw
(
short
*
tab
,
int
val
,
int
n
)
{
int
i
;
...
...
libavcodec/mpeg4videoenc.c
View file @
1deb66c5
...
...
@@ -425,6 +425,46 @@ static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64],
}
}
static
inline
int
get_b_cbp
(
MpegEncContext
*
s
,
DCTELEM
block
[
6
][
64
],
int
motion_x
,
int
motion_y
,
int
mb_type
)
{
int
cbp
=
0
,
i
;
if
(
s
->
flags
&
CODEC_FLAG_CBP_RD
)
{
int
score
=
0
;
const
int
lambda
=
s
->
lambda2
>>
(
FF_LAMBDA_SHIFT
-
6
);
for
(
i
=
0
;
i
<
6
;
i
++
)
if
(
s
->
coded_score
[
i
]
<
0
)
{
score
+=
s
->
coded_score
[
i
];
cbp
|=
1
<<
(
5
-
i
);
}
if
(
cbp
)
{
int
zero_score
=
-
6
;
if
((
motion_x
|
motion_y
|
s
->
dquant
|
mb_type
)
==
0
)
zero_score
-=
4
;
//2*MV + mb_type + cbp bit
zero_score
*=
lambda
;
if
(
zero_score
<=
score
)
cbp
=
0
;
}
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
(
s
->
block_last_index
[
i
]
>=
0
&&
((
cbp
>>
(
5
-
i
))
&
1
)
==
0
)
{
s
->
block_last_index
[
i
]
=
-
1
;
s
->
dsp
.
clear_block
(
s
->
block
[
i
]);
}
}
}
else
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
(
s
->
block_last_index
[
i
]
>=
0
)
cbp
|=
1
<<
(
5
-
i
);
}
}
return
cbp
;
}
//FIXME this is duplicated to h263.c
static
const
int
dquant_code
[
5
]
=
{
1
,
0
,
9
,
2
,
3
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment