Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
beae501e
Commit
beae501e
authored
May 08, 2013
by
John Koleszar
Committed by
Gerrit Code Review
May 09, 2013
Browse files
vpxenc: fix mismatch check for non-4:2:0
Change-Id: Iffe7c2e6c6cb14b637420ffc368a5003f5db42fa
parent
da58436f
Changes
1
Hide whitespace changes
Inline
Side-by-side
vpxenc.c
View file @
beae501e
...
...
@@ -1484,7 +1484,10 @@ static void show_rate_histogram(struct rate_hist *hist,
static
void
find_mismatch
(
vpx_image_t
*
img1
,
vpx_image_t
*
img2
,
int
yloc
[
4
],
int
uloc
[
4
],
int
vloc
[
4
])
{
const
unsigned
int
bsize
=
64
;
const
unsigned
int
bsize2
=
bsize
>>
1
;
const
unsigned
int
bsizey
=
bsize
>>
img1
->
y_chroma_shift
;
const
unsigned
int
bsizex
=
bsize
>>
img1
->
x_chroma_shift
;
const
int
c_w
=
(
img1
->
d_w
+
img1
->
x_chroma_shift
)
>>
img1
->
x_chroma_shift
;
const
int
c_h
=
(
img1
->
d_h
+
img1
->
y_chroma_shift
)
>>
img1
->
y_chroma_shift
;
unsigned
int
match
=
1
;
unsigned
int
i
,
j
;
yloc
[
0
]
=
yloc
[
1
]
=
yloc
[
2
]
=
yloc
[
3
]
=
-
1
;
...
...
@@ -1513,11 +1516,11 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
}
uloc
[
0
]
=
uloc
[
1
]
=
uloc
[
2
]
=
uloc
[
3
]
=
-
1
;
for
(
i
=
0
,
match
=
1
;
match
&&
i
<
(
img1
->
d_h
+
1
)
/
2
;
i
+=
bsize
2
)
{
for
(
j
=
0
;
j
<
match
&&
(
img1
->
d_w
+
1
)
/
2
;
j
+=
bsize
2
)
{
for
(
i
=
0
,
match
=
1
;
match
&&
i
<
c_h
;
i
+=
bsize
y
)
{
for
(
j
=
0
;
j
<
match
&&
c_w
;
j
+=
bsize
x
)
{
int
k
,
l
;
int
si
=
mmin
(
i
+
bsize
2
,
(
img1
->
d_h
+
1
)
/
2
)
-
i
;
int
sj
=
mmin
(
j
+
bsize
2
,
(
img1
->
d_w
+
1
)
/
2
)
-
j
;
int
si
=
mmin
(
i
+
bsize
y
,
c_h
-
i
)
;
int
sj
=
mmin
(
j
+
bsize
x
,
c_w
-
j
)
;
for
(
k
=
0
;
match
&&
k
<
si
;
k
++
)
for
(
l
=
0
;
match
&&
l
<
sj
;
l
++
)
{
if
(
*
(
img1
->
planes
[
VPX_PLANE_U
]
+
...
...
@@ -1537,11 +1540,11 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
}
}
vloc
[
0
]
=
vloc
[
1
]
=
vloc
[
2
]
=
vloc
[
3
]
=
-
1
;
for
(
i
=
0
,
match
=
1
;
match
&&
i
<
(
img1
->
d_h
+
1
)
/
2
;
i
+=
bsize
2
)
{
for
(
j
=
0
;
j
<
match
&&
(
img1
->
d_w
+
1
)
/
2
;
j
+=
bsize
2
)
{
for
(
i
=
0
,
match
=
1
;
match
&&
i
<
c_h
;
i
+=
bsize
y
)
{
for
(
j
=
0
;
j
<
match
&&
c_w
;
j
+=
bsize
x
)
{
int
k
,
l
;
int
si
=
mmin
(
i
+
bsize
2
,
(
img1
->
d_h
+
1
)
/
2
)
-
i
;
int
sj
=
mmin
(
j
+
bsize
2
,
(
img1
->
d_w
+
1
)
/
2
)
-
j
;
int
si
=
mmin
(
i
+
bsize
y
,
c_h
-
i
)
;
int
sj
=
mmin
(
j
+
bsize
x
,
c_w
-
j
)
;
for
(
k
=
0
;
match
&&
k
<
si
;
k
++
)
for
(
l
=
0
;
match
&&
l
<
sj
;
l
++
)
{
if
(
*
(
img1
->
planes
[
VPX_PLANE_V
]
+
...
...
@@ -1564,6 +1567,8 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
static
int
compare_img
(
vpx_image_t
*
img1
,
vpx_image_t
*
img2
)
{
const
int
c_w
=
(
img1
->
d_w
+
img1
->
x_chroma_shift
)
>>
img1
->
x_chroma_shift
;
const
int
c_h
=
(
img1
->
d_h
+
img1
->
y_chroma_shift
)
>>
img1
->
y_chroma_shift
;
int
match
=
1
;
unsigned
int
i
;
...
...
@@ -1576,15 +1581,15 @@ static int compare_img(vpx_image_t *img1, vpx_image_t *img2)
img2
->
planes
[
VPX_PLANE_Y
]
+
i
*
img2
->
stride
[
VPX_PLANE_Y
],
img1
->
d_w
)
==
0
);
for
(
i
=
0
;
i
<
img1
->
d_h
/
2
;
i
++
)
for
(
i
=
0
;
i
<
c_h
;
i
++
)
match
&=
(
memcmp
(
img1
->
planes
[
VPX_PLANE_U
]
+
i
*
img1
->
stride
[
VPX_PLANE_U
],
img2
->
planes
[
VPX_PLANE_U
]
+
i
*
img2
->
stride
[
VPX_PLANE_U
],
(
img1
->
d_w
+
1
)
/
2
)
==
0
);
c_w
)
==
0
);
for
(
i
=
0
;
i
<
img1
->
d_h
/
2
;
i
++
)
for
(
i
=
0
;
i
<
c_h
;
i
++
)
match
&=
(
memcmp
(
img1
->
planes
[
VPX_PLANE_V
]
+
i
*
img1
->
stride
[
VPX_PLANE_U
],
img2
->
planes
[
VPX_PLANE_V
]
+
i
*
img2
->
stride
[
VPX_PLANE_U
],
(
img1
->
d_w
+
1
)
/
2
)
==
0
);
c_w
)
==
0
);
return
match
;
}
...
...
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