Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
48c06386
Commit
48c06386
authored
9 years ago
by
Vittorio Giovara
Browse files
Options
Downloads
Patches
Plain Diff
dpx: Replace avpicture functions with imgutils
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
f0a10657
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/dpxenc.c
+9
-6
9 additions, 6 deletions
libavcodec/dpxenc.c
with
9 additions
and
6 deletions
libavcodec/dpxenc.c
+
9
−
6
View file @
48c06386
...
...
@@ -78,7 +78,7 @@ do { \
else AV_WL32(p, value); \
} while(0)
static
void
encode_rgb48_10bit
(
AVCodecContext
*
avctx
,
const
AV
Pictur
e
*
pic
,
static
void
encode_rgb48_10bit
(
AVCodecContext
*
avctx
,
const
AV
Fram
e
*
pic
,
uint8_t
*
dst
)
{
DPXContext
*
s
=
avctx
->
priv_data
;
...
...
@@ -115,7 +115,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if
(
s
->
bits_per_component
==
10
)
size
=
avctx
->
height
*
avctx
->
width
*
4
;
else
size
=
avpicture_get_size
(
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
);
size
=
av_image_get_buffer_size
(
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
,
1
);
if
((
ret
=
ff_alloc_packet
(
pkt
,
size
+
HEADER_SIZE
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error getting output packet.
\n
"
);
return
ret
;
...
...
@@ -153,14 +154,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
switch
(
s
->
bits_per_component
)
{
case
8
:
case
16
:
size
=
avpicture_layout
((
const
AVPicture
*
)
frame
,
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
,
buf
+
HEADER_SIZE
,
pkt
->
size
-
HEADER_SIZE
);
size
=
av_image_copy_to_buffer
(
buf
+
HEADER_SIZE
,
pkt
->
size
-
HEADER_SIZE
,
frame
->
data
,
frame
->
linesize
,
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
,
1
);
if
(
size
<
0
)
return
size
;
break
;
case
10
:
encode_rgb48_10bit
(
avctx
,
(
const
AVPicture
*
)
frame
,
buf
+
HEADER_SIZE
);
encode_rgb48_10bit
(
avctx
,
frame
,
buf
+
HEADER_SIZE
);
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unsupported bit depth: %d
\n
"
,
s
->
bits_per_component
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment