Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e5ec6869
Commit
e5ec6869
authored
Aug 10, 2011
by
Kostya Shishkov
Committed by
Ronald S. Bultje
Aug 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RV3/4: calculate B-frame motion weights once per frame
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
d241f51e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
rv34.c
libavcodec/rv34.c
+12
-5
rv34.h
libavcodec/rv34.h
+1
-0
No files found.
libavcodec/rv34.c
View file @
e5ec6869
...
...
@@ -568,12 +568,8 @@ static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int
*/
static
int
calc_add_mv
(
RV34DecContext
*
r
,
int
dir
,
int
val
)
{
int
refdist
=
GET_PTS_DIFF
(
r
->
next_pts
,
r
->
last_pts
);
int
dist
=
dir
?
-
GET_PTS_DIFF
(
r
->
next_pts
,
r
->
cur_pts
)
:
GET_PTS_DIFF
(
r
->
cur_pts
,
r
->
last_pts
);
int
mul
;
int
mul
=
dir
?
-
r
->
weight2
:
r
->
weight1
;
if
(
!
refdist
)
return
0
;
mul
=
(
dist
<<
14
)
/
refdist
;
return
(
val
*
mul
+
0x2000
)
>>
14
;
}
...
...
@@ -1273,6 +1269,17 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
if
(
s
->
pict_type
!=
AV_PICTURE_TYPE_B
){
r
->
last_pts
=
r
->
next_pts
;
r
->
next_pts
=
r
->
cur_pts
;
}
else
{
int
refdist
=
GET_PTS_DIFF
(
r
->
next_pts
,
r
->
last_pts
);
int
dist0
=
GET_PTS_DIFF
(
r
->
cur_pts
,
r
->
last_pts
);
int
dist1
=
GET_PTS_DIFF
(
r
->
next_pts
,
r
->
cur_pts
);
if
(
!
refdist
){
r
->
weight1
=
r
->
weight2
=
8192
;
}
else
{
r
->
weight1
=
(
dist0
<<
14
)
/
refdist
;
r
->
weight2
=
(
dist1
<<
14
)
/
refdist
;
}
}
s
->
mb_x
=
s
->
mb_y
=
0
;
}
...
...
libavcodec/rv34.h
View file @
e5ec6869
...
...
@@ -107,6 +107,7 @@ typedef struct RV34DecContext{
int
rpr
;
///< one field size in RV30 slice header
int
cur_pts
,
last_pts
,
next_pts
;
int
weight1
,
weight2
;
///< B frame distance fractions (0.14) used in motion compensation
uint16_t
*
cbp_luma
;
///< CBP values for luma subblocks
uint8_t
*
cbp_chroma
;
///< CBP values for chroma subblocks
...
...
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