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
13ba872a
Commit
13ba872a
authored
Jun 22, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snowenc: update pix_sum for rectangles, needed for non 420
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b4b7471e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
snowenc.c
libavcodec/snowenc.c
+6
-6
No files found.
libavcodec/snowenc.c
View file @
13ba872a
...
...
@@ -252,12 +252,12 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
//near copy & paste from dsputil, FIXME
static
int
pix_sum
(
uint8_t
*
pix
,
int
line_size
,
int
w
)
static
int
pix_sum
(
uint8_t
*
pix
,
int
line_size
,
int
w
,
int
h
)
{
int
s
,
i
,
j
;
s
=
0
;
for
(
i
=
0
;
i
<
w
;
i
++
)
{
for
(
i
=
0
;
i
<
h
;
i
++
)
{
for
(
j
=
0
;
j
<
w
;
j
++
)
{
s
+=
pix
[
0
];
pix
++
;
...
...
@@ -444,15 +444,15 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
score
+=
(
s
->
lambda2
*
(
get_rac_count
(
&
pc
)
-
base_bits
))
>>
FF_LAMBDA_SHIFT
;
block_s
=
block_w
*
block_w
;
sum
=
pix_sum
(
current_data
[
0
],
stride
,
block_w
);
sum
=
pix_sum
(
current_data
[
0
],
stride
,
block_w
,
block_w
);
l
=
(
sum
+
block_s
/
2
)
/
block_s
;
iscore
=
pix_norm1
(
current_data
[
0
],
stride
,
block_w
)
-
2
*
l
*
sum
+
l
*
l
*
block_s
;
block_s
=
block_w
*
block_w
>>
2
;
sum
=
pix_sum
(
current_data
[
1
],
uvstride
,
block_w
>>
1
);
block_s
=
block_w
*
block_w
>>
(
s
->
chroma_h_shift
+
s
->
chroma_v_shift
)
;
sum
=
pix_sum
(
current_data
[
1
],
uvstride
,
block_w
>>
s
->
chroma_h_shift
,
block_w
>>
s
->
chroma_v_shift
);
cb
=
(
sum
+
block_s
/
2
)
/
block_s
;
// iscore += pix_norm1(¤t_mb[1][0], uvstride, block_w>>1) - 2*cb*sum + cb*cb*block_s;
sum
=
pix_sum
(
current_data
[
2
],
uvstride
,
block_w
>>
1
);
sum
=
pix_sum
(
current_data
[
2
],
uvstride
,
block_w
>>
s
->
chroma_h_shift
,
block_w
>>
s
->
chroma_v_shift
);
cr
=
(
sum
+
block_s
/
2
)
/
block_s
;
// iscore += pix_norm1(¤t_mb[2][0], uvstride, block_w>>1) - 2*cr*sum + cr*cr*block_s;
...
...
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