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
b061f298
Commit
b061f298
authored
Jun 21, 2016
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truemotion2rt: Convert to the new bitstream reader
parent
e7f24c9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
truemotion2rt.c
libavcodec/truemotion2rt.c
+8
-8
No files found.
libavcodec/truemotion2rt.c
View file @
b061f298
...
...
@@ -29,11 +29,11 @@
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "
get_bits
.h"
#include "
bitstream
.h"
#include "internal.h"
typedef
struct
TrueMotion2RTContext
{
GetBitContext
gb
;
BitstreamContext
bc
;
int
delta_size
;
int
hscale
;
}
TrueMotion2RTContext
;
...
...
@@ -107,7 +107,7 @@ static int truemotion2rt_decode_frame(AVCodecContext *avctx, void *data,
{
TrueMotion2RTContext
*
s
=
avctx
->
priv_data
;
AVFrame
*
const
p
=
data
;
GetBitContext
*
gb
=
&
s
->
gb
;
BitstreamContext
*
bc
=
&
s
->
bc
;
uint8_t
*
dst
;
int
x
,
y
,
delta_mode
;
int
ret
;
...
...
@@ -116,7 +116,7 @@ static int truemotion2rt_decode_frame(AVCodecContext *avctx, void *data,
if
(
ret
<
0
)
return
ret
;
ret
=
init_get_bits8
(
gb
,
avpkt
->
data
+
ret
,
avpkt
->
size
-
ret
);
ret
=
bitstream_init8
(
bc
,
avpkt
->
data
+
ret
,
avpkt
->
size
-
ret
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -124,13 +124,13 @@ static int truemotion2rt_decode_frame(AVCodecContext *avctx, void *data,
if
(
ret
<
0
)
return
ret
;
skip_bits
(
gb
,
32
);
bitstream_skip
(
bc
,
32
);
delta_mode
=
s
->
delta_size
-
2
;
dst
=
p
->
data
[
0
];
for
(
y
=
0
;
y
<
avctx
->
height
;
y
++
)
{
int
diff
=
0
;
for
(
x
=
0
;
x
<
avctx
->
width
;
x
+=
s
->
hscale
)
{
diff
+=
delta_tabs
[
delta_mode
][
get_bits
(
gb
,
s
->
delta_size
)];
diff
+=
delta_tabs
[
delta_mode
][
bitstream_read
(
bc
,
s
->
delta_size
)];
dst
[
x
]
=
av_clip_uint8
((
y
?
dst
[
x
-
p
->
linesize
[
0
]]
:
0
)
+
diff
);
}
dst
+=
p
->
linesize
[
0
];
...
...
@@ -156,7 +156,7 @@ static int truemotion2rt_decode_frame(AVCodecContext *avctx, void *data,
for
(
y
=
0
;
y
<
avctx
->
height
>>
2
;
y
++
)
{
int
diff
=
0
;
for
(
x
=
0
;
x
<
avctx
->
width
>>
2
;
x
+=
s
->
hscale
)
{
diff
+=
delta_tabs
[
delta_mode
][
get_bits
(
gb
,
s
->
delta_size
)];
diff
+=
delta_tabs
[
delta_mode
][
bitstream_read
(
bc
,
s
->
delta_size
)];
dst
[
x
]
=
av_clip_uint8
((
y
?
dst
[
x
-
p
->
linesize
[
1
]]
:
128
)
+
diff
);
}
dst
+=
p
->
linesize
[
1
];
...
...
@@ -182,7 +182,7 @@ static int truemotion2rt_decode_frame(AVCodecContext *avctx, void *data,
for
(
y
=
0
;
y
<
avctx
->
height
>>
2
;
y
++
)
{
int
diff
=
0
;
for
(
x
=
0
;
x
<
avctx
->
width
>>
2
;
x
+=
s
->
hscale
)
{
diff
+=
delta_tabs
[
delta_mode
][
get_bits
(
gb
,
s
->
delta_size
)];
diff
+=
delta_tabs
[
delta_mode
][
bitstream_read
(
bc
,
s
->
delta_size
)];
dst
[
x
]
=
av_clip_uint8
((
y
?
dst
[
x
-
p
->
linesize
[
2
]]
:
128
)
+
diff
);
}
dst
+=
p
->
linesize
[
2
];
...
...
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