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
af1e3dfb
Commit
af1e3dfb
authored
Mar 10, 2013
by
Ronald S. Bultje
Committed by
Michael Niedermayer
Mar 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bink: use hpeldsp instead of dsputil for half-pel functions.
parent
4b642ab1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
configure
configure
+1
-1
bink.c
libavcodec/bink.c
+10
-7
No files found.
configure
View file @
af1e3dfb
...
@@ -1694,7 +1694,7 @@ ape_decoder_select="dsputil"
...
@@ -1694,7 +1694,7 @@ ape_decoder_select="dsputil"
asv_decoder_select
=
"dsputil"
asv_decoder_select
=
"dsputil"
atrac1_decoder_select
=
"mdct sinewin"
atrac1_decoder_select
=
"mdct sinewin"
atrac3_decoder_select
=
"mdct"
atrac3_decoder_select
=
"mdct"
bink_decoder_select
=
"dsputil"
bink_decoder_select
=
"dsputil
hpeldsp
"
binkaudio_dct_decoder_select
=
"mdct rdft dct sinewin"
binkaudio_dct_decoder_select
=
"mdct rdft dct sinewin"
binkaudio_rdft_decoder_select
=
"mdct rdft sinewin"
binkaudio_rdft_decoder_select
=
"mdct rdft sinewin"
cavs_decoder_select
=
"dsputil golomb h264chroma mpegvideo videodsp"
cavs_decoder_select
=
"dsputil golomb h264chroma mpegvideo videodsp"
...
...
libavcodec/bink.c
View file @
af1e3dfb
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "dsputil.h"
#include "dsputil.h"
#include "binkdata.h"
#include "binkdata.h"
#include "binkdsp.h"
#include "binkdsp.h"
#include "hpeldsp.h"
#include "internal.h"
#include "internal.h"
#include "mathops.h"
#include "mathops.h"
...
@@ -112,6 +113,7 @@ typedef struct Bundle {
...
@@ -112,6 +113,7 @@ typedef struct Bundle {
typedef
struct
BinkContext
{
typedef
struct
BinkContext
{
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
DSPContext
dsp
;
DSPContext
dsp
;
HpelDSPContext
hdsp
;
BinkDSPContext
bdsp
;
BinkDSPContext
bdsp
;
AVFrame
*
last
;
AVFrame
*
last
;
int
version
;
///< internal Bink file version
int
version
;
///< internal Bink file version
...
@@ -878,7 +880,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
...
@@ -878,7 +880,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
if
(
ref
<
ref_start
||
ref
+
8
*
stride
>
ref_end
)
{
if
(
ref
<
ref_start
||
ref
+
8
*
stride
>
ref_end
)
{
av_log
(
c
->
avctx
,
AV_LOG_WARNING
,
"Reference block is out of bounds
\n
"
);
av_log
(
c
->
avctx
,
AV_LOG_WARNING
,
"Reference block is out of bounds
\n
"
);
}
else
if
(
ref
+
8
*
stride
<
dst
||
ref
>=
dst
+
8
*
stride
)
{
}
else
if
(
ref
+
8
*
stride
<
dst
||
ref
>=
dst
+
8
*
stride
)
{
c
->
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
c
->
h
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
}
else
{
}
else
{
put_pixels8x8_overlapped
(
dst
,
ref
,
stride
);
put_pixels8x8_overlapped
(
dst
,
ref
,
stride
);
}
}
...
@@ -894,7 +896,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
...
@@ -894,7 +896,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
if
(
ref
<
ref_start
||
ref
+
8
*
stride
>
ref_end
)
{
if
(
ref
<
ref_start
||
ref
+
8
*
stride
>
ref_end
)
{
av_log
(
c
->
avctx
,
AV_LOG_WARNING
,
"Reference block is out of bounds
\n
"
);
av_log
(
c
->
avctx
,
AV_LOG_WARNING
,
"Reference block is out of bounds
\n
"
);
}
else
if
(
ref
+
8
*
stride
<
dst
||
ref
>=
dst
+
8
*
stride
)
{
}
else
if
(
ref
+
8
*
stride
<
dst
||
ref
>=
dst
+
8
*
stride
)
{
c
->
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
c
->
h
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
}
else
{
}
else
{
put_pixels8x8_overlapped
(
dst
,
ref
,
stride
);
put_pixels8x8_overlapped
(
dst
,
ref
,
stride
);
}
}
...
@@ -924,7 +926,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
...
@@ -924,7 +926,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
if
(
ref
<
ref_start
||
ref
+
8
*
stride
>
ref_end
)
{
if
(
ref
<
ref_start
||
ref
+
8
*
stride
>
ref_end
)
{
av_log
(
c
->
avctx
,
AV_LOG_WARNING
,
"Reference block is out of bounds
\n
"
);
av_log
(
c
->
avctx
,
AV_LOG_WARNING
,
"Reference block is out of bounds
\n
"
);
}
else
if
(
ref
+
8
*
stride
<
dst
||
ref
>=
dst
+
8
*
stride
)
{
}
else
if
(
ref
+
8
*
stride
<
dst
||
ref
>=
dst
+
8
*
stride
)
{
c
->
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
c
->
h
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
}
else
{
}
else
{
put_pixels8x8_overlapped
(
dst
,
ref
,
stride
);
put_pixels8x8_overlapped
(
dst
,
ref
,
stride
);
}
}
...
@@ -1013,7 +1015,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
...
@@ -1013,7 +1015,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
}
}
switch
(
blk
)
{
switch
(
blk
)
{
case
SKIP_BLOCK
:
case
SKIP_BLOCK
:
c
->
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
prev
,
stride
,
8
);
c
->
h
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
prev
,
stride
,
8
);
break
;
break
;
case
SCALED_BLOCK
:
case
SCALED_BLOCK
:
blk
=
get_value
(
c
,
BINK_SRC_SUB_BLOCK_TYPES
);
blk
=
get_value
(
c
,
BINK_SRC_SUB_BLOCK_TYPES
);
...
@@ -1084,7 +1086,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
...
@@ -1084,7 +1086,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
bx
*
8
+
xoff
,
by
*
8
+
yoff
);
bx
*
8
+
xoff
,
by
*
8
+
yoff
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
c
->
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
c
->
h
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
break
;
break
;
case
RUN_BLOCK
:
case
RUN_BLOCK
:
scan
=
bink_patterns
[
get_bits
(
gb
,
4
)];
scan
=
bink_patterns
[
get_bits
(
gb
,
4
)];
...
@@ -1118,7 +1120,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
...
@@ -1118,7 +1120,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
bx
*
8
+
xoff
,
by
*
8
+
yoff
);
bx
*
8
+
xoff
,
by
*
8
+
yoff
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
c
->
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
c
->
h
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
c
->
dsp
.
clear_block
(
block
);
c
->
dsp
.
clear_block
(
block
);
v
=
get_bits
(
gb
,
7
);
v
=
get_bits
(
gb
,
7
);
read_residue
(
gb
,
block
,
v
);
read_residue
(
gb
,
block
,
v
);
...
@@ -1143,7 +1145,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
...
@@ -1143,7 +1145,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
bx
*
8
+
xoff
,
by
*
8
+
yoff
);
bx
*
8
+
xoff
,
by
*
8
+
yoff
);
return
-
1
;
return
-
1
;
}
}
c
->
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
c
->
h
dsp
.
put_pixels_tab
[
1
][
0
](
dst
,
ref
,
stride
,
8
);
memset
(
dctblock
,
0
,
sizeof
(
*
dctblock
)
*
64
);
memset
(
dctblock
,
0
,
sizeof
(
*
dctblock
)
*
64
);
dctblock
[
0
]
=
get_value
(
c
,
BINK_SRC_INTER_DC
);
dctblock
[
0
]
=
get_value
(
c
,
BINK_SRC_INTER_DC
);
read_dct_coeffs
(
gb
,
dctblock
,
bink_scan
,
bink_inter_quant
,
-
1
);
read_dct_coeffs
(
gb
,
dctblock
,
bink_scan
,
bink_inter_quant
,
-
1
);
...
@@ -1305,6 +1307,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -1305,6 +1307,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx
->
pix_fmt
=
c
->
has_alpha
?
AV_PIX_FMT_YUVA420P
:
AV_PIX_FMT_YUV420P
;
avctx
->
pix_fmt
=
c
->
has_alpha
?
AV_PIX_FMT_YUVA420P
:
AV_PIX_FMT_YUV420P
;
ff_dsputil_init
(
&
c
->
dsp
,
avctx
);
ff_dsputil_init
(
&
c
->
dsp
,
avctx
);
ff_hpeldsp_init
(
&
c
->
hdsp
,
avctx
->
flags
);
ff_binkdsp_init
(
&
c
->
bdsp
);
ff_binkdsp_init
(
&
c
->
bdsp
);
if
((
ret
=
init_bundles
(
c
))
<
0
)
{
if
((
ret
=
init_bundles
(
c
))
<
0
)
{
...
...
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