hardware/intel/libva
Revisão | d58c6d4b05a42153384133288c4ecedc1a9be14d (tree) |
---|---|
Hora | 2010-07-12 16:01:42 |
Autor | Gwenole Beauchesne <gbeauchesne@spli...> |
Commiter | Xiang, Haihao |
Add I420 image format.
@@ -64,6 +64,8 @@ static const i965_image_format_map_t | ||
64 | 64 | i965_image_formats_map[I965_MAX_IMAGE_FORMATS + 1] = { |
65 | 65 | { I965_SURFACETYPE_YUV, |
66 | 66 | { VA_FOURCC('Y','V','1','2'), VA_LSB_FIRST, 12, } }, |
67 | + { I965_SURFACETYPE_YUV, | |
68 | + { VA_FOURCC('I','4','2','0'), VA_LSB_FIRST, 12, } }, | |
67 | 69 | }; |
68 | 70 | |
69 | 71 | /* List of supported subpicture formats */ |
@@ -1352,6 +1354,16 @@ i965_CreateImage(VADriverContextP ctx, | ||
1352 | 1354 | image->offsets[2] = size; |
1353 | 1355 | image->data_size = size + 2 * size2; |
1354 | 1356 | break; |
1357 | + case VA_FOURCC('I','4','2','0'): | |
1358 | + image->num_planes = 3; | |
1359 | + image->pitches[0] = width; | |
1360 | + image->offsets[0] = 0; | |
1361 | + image->pitches[1] = width2; | |
1362 | + image->offsets[1] = size; | |
1363 | + image->pitches[2] = width2; | |
1364 | + image->offsets[2] = size + size2; | |
1365 | + image->data_size = size + 2 * size2; | |
1366 | + break; | |
1355 | 1367 | default: |
1356 | 1368 | goto error; |
1357 | 1369 | } |
@@ -1549,7 +1561,9 @@ i965_GetImage(VADriverContextP ctx, | ||
1549 | 1561 | rect.height = height; |
1550 | 1562 | |
1551 | 1563 | switch (obj_image->image.format.fourcc) { |
1552 | - case VA_FOURCC('Y','V','1','2'): /* YV12 is native format here */ | |
1564 | + case VA_FOURCC('Y','V','1','2'): | |
1565 | + case VA_FOURCC('I','4','2','0'): | |
1566 | + /* I420 is native format for MPEG-2 decoded surfaces */ | |
1553 | 1567 | if (render_state->interleaved_uv) |
1554 | 1568 | goto operation_failed; |
1555 | 1569 | get_image_yv12(obj_image, image_data, obj_surface, &rect); |
@@ -43,7 +43,7 @@ | ||
43 | 43 | #define I965_MAX_PROFILES 11 |
44 | 44 | #define I965_MAX_ENTRYPOINTS 5 |
45 | 45 | #define I965_MAX_CONFIG_ATTRIBUTES 10 |
46 | -#define I965_MAX_IMAGE_FORMATS 1 | |
46 | +#define I965_MAX_IMAGE_FORMATS 2 | |
47 | 47 | #define I965_MAX_SUBPIC_FORMATS 4 |
48 | 48 | #define I965_MAX_DISPLAY_ATTRIBUTES 4 |
49 | 49 | #define I965_STR_VENDOR "i965 Driver 0.1" |