Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
libva
Commits
50107489
Commit
50107489
authored
Jun 03, 2010
by
Gwenole Beauchesne
Committed by
Xiang, Haihao
Jul 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add NV12 image format.
parent
e9c00fc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
1 deletion
+61
-1
i965_drv_video/i965_drv_video.c
i965_drv_video/i965_drv_video.c
+60
-0
i965_drv_video/i965_drv_video.h
i965_drv_video/i965_drv_video.h
+1
-1
No files found.
i965_drv_video/i965_drv_video.c
View file @
50107489
...
@@ -66,6 +66,8 @@ i965_image_formats_map[I965_MAX_IMAGE_FORMATS + 1] = {
...
@@ -66,6 +66,8 @@ i965_image_formats_map[I965_MAX_IMAGE_FORMATS + 1] = {
{
VA_FOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
),
VA_LSB_FIRST
,
12
,
}
},
{
VA_FOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
),
VA_LSB_FIRST
,
12
,
}
},
{
I965_SURFACETYPE_YUV
,
{
I965_SURFACETYPE_YUV
,
{
VA_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
),
VA_LSB_FIRST
,
12
,
}
},
{
VA_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
),
VA_LSB_FIRST
,
12
,
}
},
{
I965_SURFACETYPE_YUV
,
{
VA_FOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
VA_LSB_FIRST
,
12
,
}
},
};
};
/* List of supported subpicture formats */
/* List of supported subpicture formats */
...
@@ -1363,6 +1365,14 @@ i965_CreateImage(VADriverContextP ctx,
...
@@ -1363,6 +1365,14 @@ i965_CreateImage(VADriverContextP ctx,
image
->
offsets
[
2
]
=
size
+
size2
;
image
->
offsets
[
2
]
=
size
+
size2
;
image
->
data_size
=
size
+
2
*
size2
;
image
->
data_size
=
size
+
2
*
size2
;
break
;
break
;
case
VA_FOURCC
(
'N'
,
'V'
,
'1'
,
'2'
):
image
->
num_planes
=
2
;
image
->
pitches
[
0
]
=
width
;
image
->
offsets
[
0
]
=
0
;
image
->
pitches
[
1
]
=
width
;
image
->
offsets
[
1
]
=
size
;
image
->
data_size
=
size
+
2
*
size2
;
break
;
default:
default:
goto
error
;
goto
error
;
}
}
...
@@ -1519,6 +1529,50 @@ get_image_yv12(struct object_image *obj_image, uint8_t *image_data,
...
@@ -1519,6 +1529,50 @@ get_image_yv12(struct object_image *obj_image, uint8_t *image_data,
dri_bo_unmap
(
obj_surface
->
bo
);
dri_bo_unmap
(
obj_surface
->
bo
);
}
}
static
void
get_image_nv12
(
struct
object_image
*
obj_image
,
uint8_t
*
image_data
,
struct
object_surface
*
obj_surface
,
const
VARectangle
*
rect
)
{
uint8_t
*
dst
,
*
src
;
int
i
,
x
,
y
,
w
,
h
;
if
(
!
obj_surface
->
bo
)
return
;
dri_bo_map
(
obj_surface
->
bo
,
0
);
if
(
!
obj_surface
->
bo
->
virtual
)
return
;
x
=
rect
->
x
;
y
=
rect
->
y
;
w
=
rect
->
width
;
h
=
rect
->
height
;
dst
=
image_data
+
obj_image
->
image
.
offsets
[
0
]
+
y
*
obj_image
->
image
.
pitches
[
0
]
+
x
;
src
=
(
uint8_t
*
)
obj_surface
->
bo
->
virtual
+
y
*
obj_surface
->
width
+
x
;
for
(
i
=
0
;
i
<
h
;
i
++
)
{
memcpy
(
dst
,
src
,
w
);
dst
+=
obj_image
->
image
.
pitches
[
0
];
src
+=
obj_surface
->
width
;
}
x
/=
2
;
y
/=
2
;
h
/=
2
;
dst
=
image_data
+
obj_image
->
image
.
offsets
[
1
]
+
y
*
obj_image
->
image
.
pitches
[
1
]
+
x
*
2
;
src
=
(
uint8_t
*
)
obj_surface
->
bo
->
virtual
+
obj_surface
->
width
*
obj_surface
->
height
+
y
*
obj_surface
->
width
+
x
*
2
;
for
(
i
=
0
;
i
<
h
;
i
++
)
{
memcpy
(
dst
,
src
,
w
);
dst
+=
obj_image
->
image
.
pitches
[
1
];
src
+=
obj_surface
->
width
;
}
dri_bo_unmap
(
obj_surface
->
bo
);
}
VAStatus
VAStatus
i965_GetImage
(
VADriverContextP
ctx
,
i965_GetImage
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
surface
,
...
@@ -1569,6 +1623,12 @@ i965_GetImage(VADriverContextP ctx,
...
@@ -1569,6 +1623,12 @@ i965_GetImage(VADriverContextP ctx,
goto
operation_failed
;
goto
operation_failed
;
get_image_yv12
(
obj_image
,
image_data
,
obj_surface
,
&
rect
);
get_image_yv12
(
obj_image
,
image_data
,
obj_surface
,
&
rect
);
break
;
break
;
case
VA_FOURCC
(
'N'
,
'V'
,
'1'
,
'2'
):
/* NV12 is native format for H.264 decoded surfaces */
if
(
!
render_state
->
interleaved_uv
)
goto
operation_failed
;
get_image_nv12
(
obj_image
,
image_data
,
obj_surface
,
&
rect
);
break
;
default:
default:
operation_failed:
operation_failed:
va_status
=
VA_STATUS_ERROR_OPERATION_FAILED
;
va_status
=
VA_STATUS_ERROR_OPERATION_FAILED
;
...
...
i965_drv_video/i965_drv_video.h
View file @
50107489
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
#define I965_MAX_PROFILES 11
#define I965_MAX_PROFILES 11
#define I965_MAX_ENTRYPOINTS 5
#define I965_MAX_ENTRYPOINTS 5
#define I965_MAX_CONFIG_ATTRIBUTES 10
#define I965_MAX_CONFIG_ATTRIBUTES 10
#define I965_MAX_IMAGE_FORMATS
2
#define I965_MAX_IMAGE_FORMATS
3
#define I965_MAX_SUBPIC_FORMATS 4
#define I965_MAX_SUBPIC_FORMATS 4
#define I965_MAX_DISPLAY_ATTRIBUTES 4
#define I965_MAX_DISPLAY_ATTRIBUTES 4
#define I965_STR_VENDOR "i965 Driver 0.1"
#define I965_STR_VENDOR "i965 Driver 0.1"
...
...
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