Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
8590276e
Commit
8590276e
authored
Jan 17, 2014
by
Alex Converse
Committed by
Gerrit Code Review
Jan 17, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Add Y4mVideoSource to be used with 4:4:4 tests."
parents
2bfafefb
8a0b0a03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
0 deletions
+109
-0
test/test.mk
test/test.mk
+2
-0
test/y4m_video_source.h
test/y4m_video_source.h
+107
-0
No files found.
test/test.mk
View file @
8590276e
...
...
@@ -24,6 +24,8 @@ LIBVPX_TEST_SRCS-yes += encode_test_driver.cc
LIBVPX_TEST_SRCS-yes
+=
encode_test_driver.h
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
error_resilience_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
i420_video_source.h
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
y4m_video_source.h
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
../y4minput.h ../y4minput.c
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER)
+=
keyframe_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
borders_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
resize_test.cc
...
...
test/y4m_video_source.h
0 → 100644
View file @
8590276e
/*
* Copyright (c) 2012 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.
*/
#ifndef TEST_Y4M_VIDEO_SOURCE_H_
#define TEST_Y4M_VIDEO_SOURCE_H_
#include <string>
#include "test/video_source.h"
extern
"C"
{
#include "./y4minput.h"
}
namespace
libvpx_test
{
// This class extends VideoSource to allow parsing of raw yv12
// so that we can do actual file encodes.
class
Y4mVideoSource
:
public
VideoSource
{
public:
Y4mVideoSource
(
const
std
::
string
&
file_name
,
unsigned
int
start
,
int
limit
)
:
file_name_
(
file_name
),
input_file_
(
NULL
),
img_
(
new
vpx_image_t
()),
start_
(
start
),
limit_
(
limit
),
frame_
(
0
),
framerate_numerator_
(
0
),
framerate_denominator_
(
0
),
y4m_
()
{
}
virtual
~
Y4mVideoSource
()
{
vpx_img_free
(
img_
.
get
());
y4m_input_close
(
&
y4m_
);
if
(
input_file_
)
fclose
(
input_file_
);
}
virtual
void
Begin
()
{
if
(
input_file_
)
fclose
(
input_file_
);
input_file_
=
OpenTestDataFile
(
file_name_
);
ASSERT_TRUE
(
input_file_
!=
NULL
)
<<
"Input file open failed. Filename: "
<<
file_name_
;
y4m_input_open
(
&
y4m_
,
input_file_
,
NULL
,
0
,
0
);
framerate_numerator_
=
y4m_
.
fps_n
;
framerate_denominator_
=
y4m_
.
fps_d
;
frame_
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
start_
;
i
++
)
{
Next
();
}
FillFrame
();
}
virtual
void
Next
()
{
++
frame_
;
FillFrame
();
}
virtual
vpx_image_t
*
img
()
const
{
return
(
frame_
<
limit_
)
?
img_
.
get
()
:
NULL
;
}
// Models a stream where Timebase = 1/FPS, so pts == frame.
virtual
vpx_codec_pts_t
pts
()
const
{
return
frame_
;
}
virtual
unsigned
long
duration
()
const
{
return
1
;
}
virtual
vpx_rational_t
timebase
()
const
{
const
vpx_rational_t
t
=
{
framerate_denominator_
,
framerate_numerator_
};
return
t
;
}
virtual
unsigned
int
frame
()
const
{
return
frame_
;
}
virtual
unsigned
int
limit
()
const
{
return
limit_
;
}
virtual
void
FillFrame
()
{
ASSERT_TRUE
(
input_file_
!=
NULL
);
// Read a frame from input_file.
y4m_input_fetch_frame
(
&
y4m_
,
input_file_
,
img_
.
get
());
}
protected:
std
::
string
file_name_
;
FILE
*
input_file_
;
testing
::
internal
::
scoped_ptr
<
vpx_image_t
>
img_
;
unsigned
int
start_
;
unsigned
int
limit_
;
unsigned
int
frame_
;
int
framerate_numerator_
;
int
framerate_denominator_
;
y4m_input
y4m_
;
};
}
// namespace libvpx_test
#endif // TEST_Y4M_VIDEO_SOURCE_H_
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