Sample Usage
3-5
3.1.4
Algorithm Instance Deletion
Once decoding/encoding is complete, the test application must release the resources granted by
the IRES resource Manager interface and delete the current algorithm instance. The following APIs
are called in sequence:
1)
Free all resources granted by RMAN
2)
algNumAlloc()
- To query the algorithm about the number of memory
records it used.
3)
algFree()
- To query the algorithm to get the memory record
information.
A sample implementation of the delete function that calls
algNumAlloc()
and
algFree()
in
sequence is provided in the
ALG_delete()
function implemented in the alg_create.c file.
After successful execution of the algorithm, the test application frees up the DMA Resource
allocated for the algorithm. This is implemented by calling the RMAN interface functions in the
following sequence:
4)
RMAN_freeResources ()
- To free the resources that were allocated
to the algorithm before process call.
5)
RMAN_exit() - To delete the generic IRES RMAN and
release memory.
3.2
Frame Buffer Management
3.2.1
Input Frame Buffer
The encoder has input buffers that stores frames until they are processed. These buffers at the
input level are associated with a buffer input IDs. The IDs are required to track the buffers that
have been processed or locked. The encoder uses this ID, at the end of the process call, to inform
back to application whether it is a free buffer or not. Any buffer given to the algorithm should be
considered locked by the algorithm, unless the buffer is returned to the application through
IVIDENC2_OutArgs->freeBufID[]
.For more information, see section 4.2.1.11.
For example, consider the GOP structure for IPPPP frames.
Frame Type
I
P
P
P
P
Input ID
1
2
3
4
5
Free Buffer ID
1
2
3
4
5
As shown in the table, if the input ID for the first frame is 1, the same input ID is returned as the free
buffer ID at the end of the process call. There is no locking of buffers at any point.
Now, consider the GOP structure that has B frames, IBBPBBP.
Frame Type
I
B
B
P
B
B
P
Input ID
1
2
3
4
5
6
7
Free Buffer ID
0
0
1
4
2
3
7
Содержание 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 ...