Skip to content

Commit 520b9e5

Browse files
JisterXinfengZhang
authored andcommitted
Add new definition for input/output surface flag
The added bits in input_surface_flag/output_surface_flag are used to specify the sample type for scaling of interlaced content. Signed-off-by: Chen, Jason K <[email protected]>
1 parent 87dcca0 commit 520b9e5

File tree

2 files changed

+54
-5
lines changed

2 files changed

+54
-5
lines changed

va/va.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,18 @@ typedef int VAStatus; /** Return status type from functions */
214214
#define VA_STATUS_ERROR_NOT_ENOUGH_BUFFER 0x00000025
215215
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
216216

217-
/** De-interlacing flags for vaPutSurface() */
217+
/**
218+
* 1. De-interlacing flags for vaPutSurface()
219+
* 2. Surface sample type for input/output surface flag
220+
* - Progressive: VA_FRAME_PICTURE
221+
* - Interleaved: VA_TOP_FIELD_FIRST, VA_BOTTOM_FIELD_FIRST
222+
* - Field: VA_TOP_FIELD, VA_BOTTOM_FIELD
223+
*/
218224
#define VA_FRAME_PICTURE 0x00000000
219225
#define VA_TOP_FIELD 0x00000001
220226
#define VA_BOTTOM_FIELD 0x00000002
227+
#define VA_TOP_FIELD_FIRST 0x00000004
228+
#define VA_BOTTOM_FIELD_FIRST 0x00000008
221229

222230
/**
223231
* Enabled the positioning/cropping/blending feature:

va/va_vpp.h

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,15 +1012,56 @@ typedef struct _VAProcPipelineParameterBuffer {
10121012
/**
10131013
* \brief Flag to indicate the input surface flag
10141014
*
1015-
* bit0: 0 non-protected 1: protected
1016-
* bit 1~31 for future
1015+
* bit0~3: Surface sample type
1016+
* - 0000: Progressive --> VA_FRAME_PICTURE
1017+
* - 0001: Single Top Field --> VA_TOP_FIELD
1018+
* - 0010: Single Bottom Field --> VA_BOTTOM_FIELD
1019+
* - 0100: Interleaved Top Field First --> VA_TOP_FIELD_FIRST
1020+
* - 1000: Interleaved Bottom Field First --> VA_BOTTOM_FIELD_FIRST
1021+
*
1022+
* For interlaced scaling, examples as follow:
1023+
* - 1. Interleaved to Interleaved (Suppose input is top field first)
1024+
* -- set input_surface_flag as VA_TOP_FIELD_FIRST
1025+
* -- set output_surface_flag as VA_TOP_FIELD_FIRST
1026+
* - 2. Interleaved to Field (Suppose input is top field first)
1027+
* An interleaved frame need to be passed twice.
1028+
* First cycle to get the first field:
1029+
* -- set input_surface_flag as VA_TOP_FIELD_FIRST
1030+
* -- set output_surface_flag as VA_TOP_FIELD
1031+
* Second cycle to get the second field:
1032+
* -- set input_surface_flag as VA_TOP_FIELD_FIRST
1033+
* -- set output_surface_flag as VA_BOTTOM_FIELD
1034+
* - 3. Field to Interleaved (Suppose first field is top field)
1035+
* -- create two surfaces, one for top field, the other for bottom field
1036+
* -- set surface with the first field surface id
1037+
* -- set backward_reference with the second field surface id
1038+
* -- set input_surface_flag as VA_TOP_FIELD
1039+
* -- set output_surface_flag as VA_TOP_FIELD_FIRST
1040+
* - 4. Field to Field:
1041+
* -- set flag according to each frame.
1042+
*
1043+
* bit31: Surface encryption
1044+
* - 0: non-protected
1045+
* - 1: protected
1046+
*
1047+
* bit4~30 for future
10171048
*/
10181049
uint32_t input_surface_flag;
10191050
/**
10201051
* \brief Flag to indicate the output surface flag
10211052
*
1022-
* bit0: 0 non-protected 1: protected
1023-
* bit 1~31 for future
1053+
* bit0~3: Surface sample type
1054+
* - 0000: Progressive --> VA_FRAME_PICTURE
1055+
* - 0001: Top Field --> VA_TOP_FIELD
1056+
* - 0010: Bottom Field --> VA_BOTTOM_FIELD
1057+
* - 0100: Top Field First --> VA_TOP_FIELD_FIRST
1058+
* - 1000: Bottom Field First --> VA_BOTTOM_FIELD_FIRST
1059+
*
1060+
* bit31: Surface encryption
1061+
* - 0: non-protected
1062+
* - 1: protected
1063+
*
1064+
* bit4~30 for future
10241065
*/
10251066
uint32_t output_surface_flag;
10261067
/**

0 commit comments

Comments
 (0)