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
40901fc1
Commit
40901fc1
authored
Dec 12, 2011
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rv34: move 4x4 dequant to RV34DSPContext
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
5cd56e19
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
16 deletions
+19
-16
rv34.c
libavcodec/rv34.c
+2
-16
rv34dsp.c
libavcodec/rv34dsp.c
+16
-0
rv34dsp.h
libavcodec/rv34dsp.h
+1
-0
No files found.
libavcodec/rv34.c
View file @
40901fc1
...
@@ -288,20 +288,6 @@ static inline void rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *r
...
@@ -288,20 +288,6 @@ static inline void rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *r
}
}
/**
* Dequantize ordinary 4x4 block.
* @todo optimize
*/
static
inline
void
rv34_dequant4x4
(
DCTELEM
*
block
,
int
Qdc
,
int
Q
)
{
int
i
,
j
;
block
[
0
]
=
(
block
[
0
]
*
Qdc
+
8
)
>>
4
;
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
j
=
!
i
;
j
<
4
;
j
++
)
block
[
j
+
i
*
8
]
=
(
block
[
j
+
i
*
8
]
*
Q
+
8
)
>>
4
;
}
/**
/**
* Dequantize 4x4 block of DC values for 16x16 macroblock.
* Dequantize 4x4 block of DC values for 16x16 macroblock.
* @todo optimize
* @todo optimize
...
@@ -1159,7 +1145,7 @@ static int rv34_decode_macroblock(RV34DecContext *r, int8_t *intra_types)
...
@@ -1159,7 +1145,7 @@ static int rv34_decode_macroblock(RV34DecContext *r, int8_t *intra_types)
blkoff
=
((
i
&
1
)
<<
2
)
+
((
i
&
4
)
<<
3
);
blkoff
=
((
i
&
1
)
<<
2
)
+
((
i
&
4
)
<<
3
);
if
(
cbp
&
1
)
if
(
cbp
&
1
)
rv34_decode_block
(
s
->
block
[
blknum
]
+
blkoff
,
gb
,
r
->
cur_vlcs
,
r
->
luma_vlc
,
0
);
rv34_decode_block
(
s
->
block
[
blknum
]
+
blkoff
,
gb
,
r
->
cur_vlcs
,
r
->
luma_vlc
,
0
);
rv34_dequant4x4
(
s
->
block
[
blknum
]
+
blkoff
,
rv34_qscale_tab
[
s
->
qscale
],
rv34_qscale_tab
[
s
->
qscale
]);
r
->
rdsp
.
r
v34_dequant4x4
(
s
->
block
[
blknum
]
+
blkoff
,
rv34_qscale_tab
[
s
->
qscale
],
rv34_qscale_tab
[
s
->
qscale
]);
if
(
r
->
is16
)
//FIXME: optimize
if
(
r
->
is16
)
//FIXME: optimize
s
->
block
[
blknum
][
blkoff
]
=
block16
[(
i
&
3
)
|
((
i
&
0xC
)
<<
1
)];
s
->
block
[
blknum
][
blkoff
]
=
block16
[(
i
&
3
)
|
((
i
&
0xC
)
<<
1
)];
r
->
rdsp
.
rv34_inv_transform_tab
[
0
](
s
->
block
[
blknum
]
+
blkoff
);
r
->
rdsp
.
rv34_inv_transform_tab
[
0
](
s
->
block
[
blknum
]
+
blkoff
);
...
@@ -1171,7 +1157,7 @@ static int rv34_decode_macroblock(RV34DecContext *r, int8_t *intra_types)
...
@@ -1171,7 +1157,7 @@ static int rv34_decode_macroblock(RV34DecContext *r, int8_t *intra_types)
blknum
=
((
i
&
4
)
>>
2
)
+
4
;
blknum
=
((
i
&
4
)
>>
2
)
+
4
;
blkoff
=
((
i
&
1
)
<<
2
)
+
((
i
&
2
)
<<
4
);
blkoff
=
((
i
&
1
)
<<
2
)
+
((
i
&
2
)
<<
4
);
rv34_decode_block
(
s
->
block
[
blknum
]
+
blkoff
,
gb
,
r
->
cur_vlcs
,
r
->
chroma_vlc
,
1
);
rv34_decode_block
(
s
->
block
[
blknum
]
+
blkoff
,
gb
,
r
->
cur_vlcs
,
r
->
chroma_vlc
,
1
);
rv34_dequant4x4
(
s
->
block
[
blknum
]
+
blkoff
,
rv34_qscale_tab
[
rv34_chroma_quant
[
1
][
s
->
qscale
]],
rv34_qscale_tab
[
rv34_chroma_quant
[
0
][
s
->
qscale
]]);
r
->
rdsp
.
r
v34_dequant4x4
(
s
->
block
[
blknum
]
+
blkoff
,
rv34_qscale_tab
[
rv34_chroma_quant
[
1
][
s
->
qscale
]],
rv34_qscale_tab
[
rv34_chroma_quant
[
0
][
s
->
qscale
]]);
r
->
rdsp
.
rv34_inv_transform_tab
[
0
](
s
->
block
[
blknum
]
+
blkoff
);
r
->
rdsp
.
rv34_inv_transform_tab
[
0
](
s
->
block
[
blknum
]
+
blkoff
);
}
}
if
(
IS_INTRA
(
s
->
current_picture_ptr
->
f
.
mb_type
[
mb_pos
]))
if
(
IS_INTRA
(
s
->
current_picture_ptr
->
f
.
mb_type
[
mb_pos
]))
...
...
libavcodec/rv34dsp.c
View file @
40901fc1
...
@@ -100,10 +100,26 @@ static void rv34_inv_transform_noround_c(DCTELEM *block){
...
@@ -100,10 +100,26 @@ static void rv34_inv_transform_noround_c(DCTELEM *block){
/** @} */
// transform
/** @} */
// transform
/**
* Dequantize ordinary 4x4 block.
*/
void
ff_rv34_dequant4x4_neon
(
DCTELEM
*
block
,
int
Qdc
,
int
Q
);
static
void
rv34_dequant4x4_c
(
DCTELEM
*
block
,
int
Qdc
,
int
Q
)
{
int
i
,
j
;
block
[
0
]
=
(
block
[
0
]
*
Qdc
+
8
)
>>
4
;
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
j
=
!
i
;
j
<
4
;
j
++
)
block
[
j
+
i
*
8
]
=
(
block
[
j
+
i
*
8
]
*
Q
+
8
)
>>
4
;
}
av_cold
void
ff_rv34dsp_init
(
RV34DSPContext
*
c
,
DSPContext
*
dsp
)
{
av_cold
void
ff_rv34dsp_init
(
RV34DSPContext
*
c
,
DSPContext
*
dsp
)
{
c
->
rv34_inv_transform_tab
[
0
]
=
rv34_inv_transform_c
;
c
->
rv34_inv_transform_tab
[
0
]
=
rv34_inv_transform_c
;
c
->
rv34_inv_transform_tab
[
1
]
=
rv34_inv_transform_noround_c
;
c
->
rv34_inv_transform_tab
[
1
]
=
rv34_inv_transform_noround_c
;
c
->
rv34_dequant4x4
=
rv34_dequant4x4_c
;
if
(
HAVE_NEON
)
if
(
HAVE_NEON
)
ff_rv34dsp_init_neon
(
c
,
dsp
);
ff_rv34dsp_init_neon
(
c
,
dsp
);
}
}
libavcodec/rv34dsp.h
View file @
40901fc1
...
@@ -48,6 +48,7 @@ typedef struct RV34DSPContext {
...
@@ -48,6 +48,7 @@ typedef struct RV34DSPContext {
h264_chroma_mc_func
avg_chroma_pixels_tab
[
3
];
h264_chroma_mc_func
avg_chroma_pixels_tab
[
3
];
rv40_weight_func
rv40_weight_pixels_tab
[
2
];
rv40_weight_func
rv40_weight_pixels_tab
[
2
];
rv34_inv_transform_func
rv34_inv_transform_tab
[
2
];
rv34_inv_transform_func
rv34_inv_transform_tab
[
2
];
void
(
*
rv34_dequant4x4
)(
DCTELEM
*
block
,
int
Qdc
,
int
Q
);
rv40_loop_filter_func
rv40_h_loop_filter
;
rv40_loop_filter_func
rv40_h_loop_filter
;
rv40_loop_filter_func
rv40_v_loop_filter
;
rv40_loop_filter_func
rv40_v_loop_filter
;
}
RV34DSPContext
;
}
RV34DSPContext
;
...
...
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