Sample Usage
3-3
3.1.1
Parameter Setup
Each codec component requires various codec configuration parameters to be set at initialization.
For example, a video codec requires parameters such as video height, video width, and so on. The
test application obtains the required parameters from the Encoder configuration files.
In this logical block, the test application does the following:
1)
Opens the configuration file, listed in TesCases.txt and reads the
2)
various configuration parameters required for the algorithm.
For more details on the configuration files, see Section 2.5.
3)
Sets the
interface
structure based on the values it reads from the
configuration file.
4)
Does the algorithm instance creation and other handshake via. control
methods
5)
For each frame reads the input yuv frame into the application input
buffer and makes a process call
6)
For each frame dumps out the generated bit-stream into the specified
file
3.1.2
Algorithm Instance Creation and Initialization
In this logical block, the test application accepts the various initialization parameters and returns an
algorithm instance pointer. The following APIs implemented by the codec are called in sequence by
ALG_create()
:
1)
algNumAlloc()
- To query the algorithm about the number of memory
records it requires.
2)
algAlloc()
- To query the algorithm about the memory requirement
to be filled in the memory records.
3)
algInit()
- To initialize the algorithm with the memory structures
provided by the application.
A sample implementation of the create function that calls
algNumAlloc()
,
algAlloc()
, and
algInit()
in sequence is provided in the
ALG_create()
function implemented in the alg_create.c
file.
After successful creation of the algorithm instance, the test application does resource allocation for
the algorithm. This requires initialization of Resource Manager Module (RMAN) and grant of
required resources (EDMA channels). This is implemented by calling RMAN interface functions in
following sequence:
1)
numResourceDescriptors()
- To understand the number of
resources needed by algorithm.
2)
getResourceDescriptors()
– To get the attributes of the resources.
initResources()
- After resources are created, application gives the resources to algorithm
through this API
Содержание H.264 High Profile Encoder
Страница 10: ...x This page is intentionally left blank ...
Страница 12: ...xii This page is intentionally left blank ...
Страница 20: ......
Страница 134: ...Frequently Asked Questions 5 4 This page is intentionally left blank ...