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
061e326b
Commit
061e326b
authored
6 years ago
by
Carl Eugen Hoyos
Browse files
Options
Downloads
Patches
Plain Diff
lavc/dpx: Support 10-bit packing method b (msbpad).
parent
af1e70dd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/dpx.c
+8
-7
8 additions, 7 deletions
libavcodec/dpx.c
with
8 additions
and
7 deletions
libavcodec/dpx.c
+
8
−
7
View file @
061e326b
...
@@ -51,7 +51,7 @@ static unsigned int read32(const uint8_t **ptr, int is_big)
...
@@ -51,7 +51,7 @@ static unsigned int read32(const uint8_t **ptr, int is_big)
}
}
static
uint16_t
read10in32
(
const
uint8_t
**
ptr
,
uint32_t
*
lbuf
,
static
uint16_t
read10in32
(
const
uint8_t
**
ptr
,
uint32_t
*
lbuf
,
int
*
n_datum
,
int
is_big
)
int
*
n_datum
,
int
is_big
,
int
shift
)
{
{
if
(
*
n_datum
)
if
(
*
n_datum
)
(
*
n_datum
)
--
;
(
*
n_datum
)
--
;
...
@@ -60,7 +60,7 @@ static uint16_t read10in32(const uint8_t **ptr, uint32_t * lbuf,
...
@@ -60,7 +60,7 @@ static uint16_t read10in32(const uint8_t **ptr, uint32_t * lbuf,
*
n_datum
=
2
;
*
n_datum
=
2
;
}
}
*
lbuf
=
(
*
lbuf
<<
10
)
|
(
*
lbuf
>>
22
)
;
*
lbuf
=
*
lbuf
<<
10
|
*
lbuf
>>
shift
&
0x3FFFFF
;
return
*
lbuf
&
0x3FF
;
return
*
lbuf
&
0x3FF
;
}
}
...
@@ -221,7 +221,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -221,7 +221,7 @@ static int decode_frame(AVCodecContext *avctx,
stride
=
avctx
->
width
*
elements
;
stride
=
avctx
->
width
*
elements
;
break
;
break
;
case
10
:
case
10
:
if
(
!
packing
||
packing
>
1
)
{
if
(
!
packing
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packing to 32bit required
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packing to 32bit required
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -360,17 +360,18 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -360,17 +360,18 @@ static int decode_frame(AVCodecContext *avctx,
(
uint16_t
*
)
ptr
[
1
],
(
uint16_t
*
)
ptr
[
1
],
(
uint16_t
*
)
ptr
[
2
],
(
uint16_t
*
)
ptr
[
2
],
(
uint16_t
*
)
ptr
[
3
]};
(
uint16_t
*
)
ptr
[
3
]};
int
shift
=
packing
==
1
?
22
:
20
;
for
(
y
=
0
;
y
<
avctx
->
width
;
y
++
)
{
for
(
y
=
0
;
y
<
avctx
->
width
;
y
++
)
{
*
dst
[
2
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
*
dst
[
2
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
);
&
n_datum
,
endian
,
shift
);
*
dst
[
0
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
*
dst
[
0
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
);
&
n_datum
,
endian
,
shift
);
*
dst
[
1
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
*
dst
[
1
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
);
&
n_datum
,
endian
,
shift
);
if
(
elements
==
4
)
if
(
elements
==
4
)
*
dst
[
3
]
++
=
*
dst
[
3
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
read10in32
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
);
&
n_datum
,
endian
,
shift
);
}
}
n_datum
=
0
;
n_datum
=
0
;
for
(
i
=
0
;
i
<
elements
;
i
++
)
for
(
i
=
0
;
i
<
elements
;
i
++
)
...
...
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