Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
aom-rav1e
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
aom-rav1e
Commits
c95eb4c7
Commit
c95eb4c7
authored
9 years ago
by
James Zern
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "vp10: fix encoder crash on flush"
parents
421bb4d4
a7beb23d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/encode_api_test.cc
+68
-0
68 additions, 0 deletions
test/encode_api_test.cc
test/test.mk
+1
-0
1 addition, 0 deletions
test/test.mk
vp10/encoder/lookahead.c
+1
-1
1 addition, 1 deletion
vp10/encoder/lookahead.c
with
70 additions
and
1 deletion
test/encode_api_test.cc
0 → 100644
+
68
−
0
View file @
c95eb4c7
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include
"third_party/googletest/src/include/gtest/gtest.h"
#include
"./vpx_config.h"
#include
"vpx/vp8cx.h"
#include
"vpx/vpx_encoder.h"
namespace
{
#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0]))
TEST
(
EncodeAPI
,
InvalidParams
)
{
static
const
vpx_codec_iface_t
*
kCodecs
[]
=
{
#if CONFIG_VP8_ENCODER
&
vpx_codec_vp8_cx_algo
,
#endif
#if CONFIG_VP9_ENCODER
&
vpx_codec_vp9_cx_algo
,
#endif
#if CONFIG_VP10_ENCODER
&
vpx_codec_vp10_cx_algo
,
#endif
};
uint8_t
buf
[
1
]
=
{
0
};
vpx_image_t
img
;
vpx_codec_ctx_t
enc
;
vpx_codec_enc_cfg_t
cfg
;
EXPECT_EQ
(
&
img
,
vpx_img_wrap
(
&
img
,
VPX_IMG_FMT_I420
,
1
,
1
,
1
,
buf
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_enc_init
(
NULL
,
NULL
,
NULL
,
0
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_enc_init
(
&
enc
,
NULL
,
NULL
,
0
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_encode
(
NULL
,
NULL
,
0
,
0
,
0
,
0
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_encode
(
NULL
,
&
img
,
0
,
0
,
0
,
0
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_destroy
(
NULL
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_enc_config_default
(
NULL
,
NULL
,
0
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_enc_config_default
(
NULL
,
&
cfg
,
0
));
EXPECT_TRUE
(
vpx_codec_error
(
NULL
)
!=
NULL
);
for
(
int
i
=
0
;
i
<
NELEMENTS
(
kCodecs
);
++
i
)
{
SCOPED_TRACE
(
vpx_codec_iface_name
(
kCodecs
[
i
]));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_enc_init
(
NULL
,
kCodecs
[
i
],
NULL
,
0
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_enc_init
(
&
enc
,
kCodecs
[
i
],
NULL
,
0
));
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_enc_config_default
(
kCodecs
[
i
],
&
cfg
,
1
));
EXPECT_EQ
(
VPX_CODEC_OK
,
vpx_codec_enc_config_default
(
kCodecs
[
i
],
&
cfg
,
0
));
EXPECT_EQ
(
VPX_CODEC_OK
,
vpx_codec_enc_init
(
&
enc
,
kCodecs
[
i
],
&
cfg
,
0
));
EXPECT_EQ
(
VPX_CODEC_OK
,
vpx_codec_encode
(
&
enc
,
NULL
,
0
,
0
,
0
,
0
));
EXPECT_EQ
(
VPX_CODEC_OK
,
vpx_codec_destroy
(
&
enc
));
}
}
}
// namespace
This diff is collapsed.
Click to expand it.
test/test.mk
+
1
−
0
View file @
c95eb4c7
...
...
@@ -18,6 +18,7 @@ LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ivf_video_source.h
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
../y4minput.h ../y4minput.c
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
aq_segment_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
datarate_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
encode_api_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
error_resilience_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
i420_video_source.h
##TODO(jimbankoski): Figure out why resize is failing.
...
...
This diff is collapsed.
Click to expand it.
vp10/encoder/lookahead.c
+
1
−
1
View file @
c95eb4c7
...
...
@@ -192,7 +192,7 @@ struct lookahead_entry *vp10_lookahead_pop(struct lookahead_ctx *ctx,
int
drain
)
{
struct
lookahead_entry
*
buf
=
NULL
;
if
(
ctx
->
sz
&&
(
drain
||
ctx
->
sz
==
ctx
->
max_sz
-
MAX_PRE_FRAMES
))
{
if
(
ctx
&&
ctx
->
sz
&&
(
drain
||
ctx
->
sz
==
ctx
->
max_sz
-
MAX_PRE_FRAMES
))
{
buf
=
pop
(
ctx
,
&
ctx
->
read_idx
);
ctx
->
sz
--
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment