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
aee675a3
Commit
aee675a3
authored
Jul 25, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intrax8: asserts cleanup
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
30051224
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
intrax8.c
libavcodec/intrax8.c
+9
-13
No files found.
libavcodec/intrax8.c
View file @
aee675a3
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
* @brief IntraX8 (J-Frame) subdecoder, used by WMV2 and VC-1
* @brief IntraX8 (J-Frame) subdecoder, used by WMV2 and VC-1
*/
*/
#include "libavutil/avassert.h"
#include "avcodec.h"
#include "avcodec.h"
#include "get_bits.h"
#include "get_bits.h"
#include "mpegvideo.h"
#include "mpegvideo.h"
...
@@ -124,13 +125,13 @@ static inline void x8_select_ac_table(IntraX8Context * const w , int mode){
...
@@ -124,13 +125,13 @@ static inline void x8_select_ac_table(IntraX8Context * const w , int mode){
MpegEncContext
*
const
s
=
w
->
s
;
MpegEncContext
*
const
s
=
w
->
s
;
int
table_index
;
int
table_index
;
a
ssert
(
mode
<
4
);
a
v_assert2
(
mode
<
4
);
if
(
w
->
j_ac_vlc
[
mode
]
)
return
;
if
(
w
->
j_ac_vlc
[
mode
]
)
return
;
table_index
=
get_bits
(
&
s
->
gb
,
3
);
table_index
=
get_bits
(
&
s
->
gb
,
3
);
w
->
j_ac_vlc
[
mode
]
=
&
j_ac_vlc
[
w
->
quant
<
13
][
mode
>>
1
][
table_index
];
//2 modes use same tables
w
->
j_ac_vlc
[
mode
]
=
&
j_ac_vlc
[
w
->
quant
<
13
][
mode
>>
1
][
table_index
];
//2 modes use same tables
a
ssert
(
w
->
j_ac_vlc
[
mode
]);
a
v_assert2
(
w
->
j_ac_vlc
[
mode
]);
}
}
static
inline
int
x8_get_orient_vlc
(
IntraX8Context
*
w
){
static
inline
int
x8_get_orient_vlc
(
IntraX8Context
*
w
){
...
@@ -141,8 +142,6 @@ static inline int x8_get_orient_vlc(IntraX8Context * w){
...
@@ -141,8 +142,6 @@ static inline int x8_get_orient_vlc(IntraX8Context * w){
table_index
=
get_bits
(
&
s
->
gb
,
1
+
(
w
->
quant
<
13
)
);
table_index
=
get_bits
(
&
s
->
gb
,
1
+
(
w
->
quant
<
13
)
);
w
->
j_orient_vlc
=
&
j_orient_vlc
[
w
->
quant
<
13
][
table_index
];
w
->
j_orient_vlc
=
&
j_orient_vlc
[
w
->
quant
<
13
][
table_index
];
}
}
assert
(
w
->
j_orient_vlc
);
assert
(
w
->
j_orient_vlc
->
table
);
return
get_vlc2
(
&
s
->
gb
,
w
->
j_orient_vlc
->
table
,
OR_VLC_BITS
,
OR_VLC_MTD
);
return
get_vlc2
(
&
s
->
gb
,
w
->
j_orient_vlc
->
table
,
OR_VLC_BITS
,
OR_VLC_MTD
);
}
}
...
@@ -264,15 +263,13 @@ static int x8_get_dc_rlf(IntraX8Context * const w,int const mode, int * const le
...
@@ -264,15 +263,13 @@ static int x8_get_dc_rlf(IntraX8Context * const w,int const mode, int * const le
MpegEncContext
*
const
s
=
w
->
s
;
MpegEncContext
*
const
s
=
w
->
s
;
int
i
,
e
,
c
;
int
i
,
e
,
c
;
a
ssert
(
mode
<
3
);
a
v_assert2
(
mode
<
3
);
if
(
!
w
->
j_dc_vlc
[
mode
]
)
{
if
(
!
w
->
j_dc_vlc
[
mode
]
)
{
int
table_index
;
int
table_index
;
table_index
=
get_bits
(
&
s
->
gb
,
3
);
table_index
=
get_bits
(
&
s
->
gb
,
3
);
//4 modes, same table
//4 modes, same table
w
->
j_dc_vlc
[
mode
]
=
&
j_dc_vlc
[
w
->
quant
<
13
][
table_index
];
w
->
j_dc_vlc
[
mode
]
=
&
j_dc_vlc
[
w
->
quant
<
13
][
table_index
];
}
}
assert
(
w
->
j_dc_vlc
);
assert
(
w
->
j_dc_vlc
[
mode
]
->
table
);
i
=
get_vlc2
(
&
s
->
gb
,
w
->
j_dc_vlc
[
mode
]
->
table
,
DC_VLC_BITS
,
DC_VLC_MTD
);
i
=
get_vlc2
(
&
s
->
gb
,
w
->
j_dc_vlc
[
mode
]
->
table
,
DC_VLC_BITS
,
DC_VLC_MTD
);
...
@@ -325,7 +322,7 @@ static int x8_setup_spatial_predictor(IntraX8Context * const w, const int chroma
...
@@ -325,7 +322,7 @@ static int x8_setup_spatial_predictor(IntraX8Context * const w, const int chroma
if
(
chroma
)
if
(
chroma
)
return
0
;
return
0
;
a
ssert
(
w
->
orient
<
3
);
a
v_assert2
(
w
->
orient
<
3
);
if
(
range
<
2
*
w
->
quant
){
if
(
range
<
2
*
w
->
quant
){
if
(
(
w
->
edges
&
3
)
==
0
){
if
(
(
w
->
edges
&
3
)
==
0
){
if
(
w
->
orient
==
1
)
w
->
orient
=
11
;
if
(
w
->
orient
==
1
)
w
->
orient
=
11
;
...
@@ -342,8 +339,8 @@ static int x8_setup_spatial_predictor(IntraX8Context * const w, const int chroma
...
@@ -342,8 +339,8 @@ static int x8_setup_spatial_predictor(IntraX8Context * const w, const int chroma
};
};
w
->
raw_orient
=
x8_get_orient_vlc
(
w
);
w
->
raw_orient
=
x8_get_orient_vlc
(
w
);
if
(
w
->
raw_orient
<
0
)
return
-
1
;
if
(
w
->
raw_orient
<
0
)
return
-
1
;
a
ssert
(
w
->
raw_orient
<
12
);
a
v_assert2
(
w
->
raw_orient
<
12
);
a
ssert
(
w
->
orient
<
3
);
a
v_assert2
(
w
->
orient
<
3
);
w
->
orient
=
prediction_table
[
w
->
orient
][
w
->
raw_orient
];
w
->
orient
=
prediction_table
[
w
->
orient
][
w
->
raw_orient
];
}
}
return
0
;
return
0
;
...
@@ -535,7 +532,7 @@ static int x8_decode_intra_mb(IntraX8Context* const w, const int chroma){
...
@@ -535,7 +532,7 @@ static int x8_decode_intra_mb(IntraX8Context* const w, const int chroma){
int
use_quant_matrix
;
int
use_quant_matrix
;
int
sign
;
int
sign
;
a
ssert
(
w
->
orient
<
12
);
a
v_assert2
(
w
->
orient
<
12
);
s
->
dsp
.
clear_block
(
s
->
block
[
0
]);
s
->
dsp
.
clear_block
(
s
->
block
[
0
]);
if
(
chroma
){
if
(
chroma
){
...
@@ -693,7 +690,7 @@ av_cold void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s
...
@@ -693,7 +690,7 @@ av_cold void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s
w
->
s
=
s
;
w
->
s
=
s
;
x8_vlc_init
();
x8_vlc_init
();
a
ssert
(
s
->
mb_width
>
0
);
a
v_assert0
(
s
->
mb_width
>
0
);
w
->
prediction_table
=
av_mallocz
(
s
->
mb_width
*
2
*
2
);
//two rows, 2 blocks per cannon mb
w
->
prediction_table
=
av_mallocz
(
s
->
mb_width
*
2
*
2
);
//two rows, 2 blocks per cannon mb
ff_init_scantable
(
s
->
dsp
.
idct_permutation
,
&
w
->
scantable
[
0
],
ff_wmv1_scantable
[
0
]);
ff_init_scantable
(
s
->
dsp
.
idct_permutation
,
&
w
->
scantable
[
0
],
ff_wmv1_scantable
[
0
]);
...
@@ -725,7 +722,6 @@ av_cold void ff_intrax8_common_end(IntraX8Context * w)
...
@@ -725,7 +722,6 @@ av_cold void ff_intrax8_common_end(IntraX8Context * w)
int
ff_intrax8_decode_picture
(
IntraX8Context
*
const
w
,
int
dquant
,
int
quant_offset
){
int
ff_intrax8_decode_picture
(
IntraX8Context
*
const
w
,
int
dquant
,
int
quant_offset
){
MpegEncContext
*
const
s
=
w
->
s
;
MpegEncContext
*
const
s
=
w
->
s
;
int
mb_xy
;
int
mb_xy
;
assert
(
s
);
w
->
use_quant_matrix
=
get_bits1
(
&
s
->
gb
);
w
->
use_quant_matrix
=
get_bits1
(
&
s
->
gb
);
w
->
dquant
=
dquant
;
w
->
dquant
=
dquant
;
...
...
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