Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
4fe940ad
Commit
4fe940ad
authored
Jun 23, 2017
by
Sebastien Alaiwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid explicit memory management
Change-Id: I181b473a6ae4b40d47682afbe136aa4aa4716ad2
parent
4f345189
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
test/superframe_test.cc
test/superframe_test.cc
+6
-9
No files found.
test/superframe_test.cc
View file @
4fe940ad
...
...
@@ -10,6 +10,7 @@
*/
#include <climits>
#include <vector>
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
...
...
@@ -28,8 +29,7 @@ class SuperframeTest
:
public
::
libaom_test
::
CodecTestWithParam
<
SuperframeTestParam
>
,
public
::
libaom_test
::
EncoderTest
{
protected:
SuperframeTest
()
:
EncoderTest
(
GET_PARAM
(
0
)),
modified_buf_
(
NULL
),
last_sf_pts_
(
0
)
{}
SuperframeTest
()
:
EncoderTest
(
GET_PARAM
(
0
)),
last_sf_pts_
(
0
)
{}
virtual
~
SuperframeTest
()
{}
virtual
void
SetUp
()
{
...
...
@@ -43,8 +43,6 @@ class SuperframeTest
n_tile_rows_
=
std
::
tr1
::
get
<
kTileRows
>
(
input
);
}
virtual
void
TearDown
()
{
delete
[]
modified_buf_
;
}
virtual
void
PreEncodeFrameHook
(
libaom_test
::
VideoSource
*
video
,
libaom_test
::
Encoder
*
encoder
)
{
if
(
video
->
frame
()
==
1
)
{
...
...
@@ -70,12 +68,11 @@ class SuperframeTest
if
((
marker
&
0xe0
)
==
0xc0
&&
pkt
->
data
.
frame
.
sz
>=
index_sz
&&
buffer
[
index_sz
-
1
]
==
marker
)
{
// frame is a superframe. strip off the index.
delete
[]
modified_buf_
;
modified_buf_
=
new
uint8_t
[
pkt
->
data
.
frame
.
sz
-
index_sz
];
memcpy
(
modified_buf_
,
(
uint8_t
*
)
pkt
->
data
.
frame
.
buf
+
index_sz
,
modified_buf_
.
resize
(
pkt
->
data
.
frame
.
sz
-
index_sz
);
memcpy
(
&
modified_buf_
[
0
],
(
uint8_t
*
)
pkt
->
data
.
frame
.
buf
+
index_sz
,
pkt
->
data
.
frame
.
sz
-
index_sz
);
modified_pkt_
=
*
pkt
;
modified_pkt_
.
data
.
frame
.
buf
=
modified_buf_
;
modified_pkt_
.
data
.
frame
.
buf
=
&
modified_buf_
[
0
]
;
modified_pkt_
.
data
.
frame
.
sz
-=
index_sz
;
sf_count_
++
;
...
...
@@ -92,7 +89,7 @@ class SuperframeTest
int
sf_count_
;
int
sf_count_max_
;
aom_codec_cx_pkt_t
modified_pkt_
;
uint8_t
*
modified_buf_
;
std
::
vector
<
uint8_t
>
modified_buf_
;
aom_codec_pts_t
last_sf_pts_
;
private:
...
...
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