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
fa3ecad0
Commit
fa3ecad0
authored
Sep 07, 2016
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: correctly set inputPitch
parent
96cba1c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
nvenc.c
libavcodec/nvenc.c
+3
-0
nvenc.h
libavcodec/nvenc.h
+1
-0
No files found.
libavcodec/nvenc.c
View file @
fa3ecad0
...
...
@@ -1403,6 +1403,7 @@ static int nvenc_upload_frame(AVCodecContext *avctx, const AVFrame *frame,
ctx
->
registered_frames
[
reg_idx
].
mapped
=
1
;
nvenc_frame
->
reg_idx
=
reg_idx
;
nvenc_frame
->
input_surface
=
nvenc_frame
->
in_map
.
mappedResource
;
nvenc_frame
->
pitch
=
frame
->
linesize
[
0
];
return
0
;
}
else
{
NV_ENC_LOCK_INPUT_BUFFER
lockBufferParams
=
{
0
};
...
...
@@ -1415,6 +1416,7 @@ static int nvenc_upload_frame(AVCodecContext *avctx, const AVFrame *frame,
return
nvenc_print_error
(
avctx
,
nv_status
,
"Failed locking nvenc input buffer"
);
}
nvenc_frame
->
pitch
=
lockBufferParams
.
pitch
;
res
=
nvenc_copy_frame
(
avctx
,
nvenc_frame
,
&
lockBufferParams
,
frame
);
nv_status
=
p_nvenc
->
nvEncUnlockInputBuffer
(
ctx
->
nvencoder
,
nvenc_frame
->
input_surface
);
...
...
@@ -1655,6 +1657,7 @@ int ff_nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pic_params
.
bufferFmt
=
inSurf
->
format
;
pic_params
.
inputWidth
=
avctx
->
width
;
pic_params
.
inputHeight
=
avctx
->
height
;
pic_params
.
inputPitch
=
inSurf
->
pitch
;
pic_params
.
outputBitstream
=
inSurf
->
output_surface
;
if
(
avctx
->
flags
&
AV_CODEC_FLAG_INTERLACED_DCT
)
{
...
...
libavcodec/nvenc.h
View file @
fa3ecad0
...
...
@@ -56,6 +56,7 @@ typedef struct NvencSurface
int
reg_idx
;
int
width
;
int
height
;
int
pitch
;
NV_ENC_OUTPUT_PTR
output_surface
;
NV_ENC_BUFFER_FORMAT
format
;
...
...
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