Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
340f12f7
Commit
340f12f7
authored
Sep 19, 2016
by
Yogender Kumar Gupta
Committed by
Anton Khirnov
Sep 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hwcontext_cuda: Add P010 and YUV444P16 pixel format
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
75d98e30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
hwcontext_cuda.c
libavutil/hwcontext_cuda.c
+22
-0
No files found.
libavutil/hwcontext_cuda.c
View file @
340f12f7
...
...
@@ -32,7 +32,9 @@ typedef struct CUDAFramesContext {
static
const
enum
AVPixelFormat
supported_formats
[]
=
{
AV_PIX_FMT_NV12
,
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_P010
,
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_YUV444P16
,
};
static
void
cuda_buffer_free
(
void
*
opaque
,
uint8_t
*
data
)
...
...
@@ -105,9 +107,15 @@ static int cuda_frames_init(AVHWFramesContext *ctx)
case
AV_PIX_FMT_YUV420P
:
size
=
ctx
->
width
*
ctx
->
height
*
3
/
2
;
break
;
case
AV_PIX_FMT_P010
:
size
=
ctx
->
width
*
ctx
->
height
*
3
;
break
;
case
AV_PIX_FMT_YUV444P
:
size
=
ctx
->
width
*
ctx
->
height
*
3
;
break
;
case
AV_PIX_FMT_YUV444P16
:
size
=
ctx
->
width
*
ctx
->
height
*
6
;
break
;
}
ctx
->
internal
->
pool_internal
=
av_buffer_pool_init2
(
size
,
ctx
,
cuda_pool_alloc
,
NULL
);
...
...
@@ -139,6 +147,12 @@ static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
frame
->
linesize
[
1
]
=
ctx
->
width
/
2
;
frame
->
linesize
[
2
]
=
ctx
->
width
/
2
;
break
;
case
AV_PIX_FMT_P010
:
frame
->
data
[
0
]
=
frame
->
buf
[
0
]
->
data
;
frame
->
data
[
1
]
=
frame
->
data
[
0
]
+
2
*
ctx
->
width
*
ctx
->
height
;
frame
->
linesize
[
0
]
=
2
*
ctx
->
width
;
frame
->
linesize
[
1
]
=
2
*
ctx
->
width
;
break
;
case
AV_PIX_FMT_YUV444P
:
frame
->
data
[
0
]
=
frame
->
buf
[
0
]
->
data
;
frame
->
data
[
1
]
=
frame
->
data
[
0
]
+
ctx
->
width
*
ctx
->
height
;
...
...
@@ -147,6 +161,14 @@ static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
frame
->
linesize
[
1
]
=
ctx
->
width
;
frame
->
linesize
[
2
]
=
ctx
->
width
;
break
;
case
AV_PIX_FMT_YUV444P16
:
frame
->
data
[
0
]
=
frame
->
buf
[
0
]
->
data
;
frame
->
data
[
1
]
=
frame
->
data
[
0
]
+
2
*
ctx
->
width
*
ctx
->
height
;
frame
->
data
[
2
]
=
frame
->
data
[
1
]
+
2
*
ctx
->
width
*
ctx
->
height
;
frame
->
linesize
[
0
]
=
2
*
ctx
->
width
;
frame
->
linesize
[
1
]
=
2
*
ctx
->
width
;
frame
->
linesize
[
2
]
=
2
*
ctx
->
width
;
break
;
default:
av_frame_unref
(
frame
);
return
AVERROR_BUG
;
...
...
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