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
9c714731
Commit
9c714731
authored
Oct 28, 2017
by
Martin Vignali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavcodec/utvideo : simplify decode_plane
the func is only call with step = 1 no need to pass it in the func
parent
97ac8a47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
utvideodec.c
libavcodec/utvideodec.c
+12
-14
No files found.
libavcodec/utvideodec.c
View file @
9c714731
...
@@ -126,7 +126,7 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
...
@@ -126,7 +126,7 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
}
}
static
int
decode_plane10
(
UtvideoContext
*
c
,
int
plane_no
,
static
int
decode_plane10
(
UtvideoContext
*
c
,
int
plane_no
,
uint16_t
*
dst
,
int
step
,
ptrdiff_t
stride
,
uint16_t
*
dst
,
ptrdiff_t
stride
,
int
width
,
int
height
,
int
width
,
int
height
,
const
uint8_t
*
src
,
const
uint8_t
*
huff
,
const
uint8_t
*
src
,
const
uint8_t
*
huff
,
int
use_pred
)
int
use_pred
)
...
@@ -152,7 +152,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no,
...
@@ -152,7 +152,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no,
prev
=
0x200
;
prev
=
0x200
;
for
(
j
=
sstart
;
j
<
send
;
j
++
)
{
for
(
j
=
sstart
;
j
<
send
;
j
++
)
{
for
(
i
=
0
;
i
<
width
*
step
;
i
+=
step
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
pix
=
fsym
;
pix
=
fsym
;
if
(
use_pred
)
{
if
(
use_pred
)
{
prev
+=
pix
;
prev
+=
pix
;
...
@@ -195,8 +195,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no,
...
@@ -195,8 +195,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no,
prev
=
0x200
;
prev
=
0x200
;
for
(
j
=
sstart
;
j
<
send
;
j
++
)
{
for
(
j
=
sstart
;
j
<
send
;
j
++
)
{
int
ws
=
width
*
step
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
ws
;
i
+=
step
)
{
pix
=
get_vlc2
(
&
gb
,
vlc
.
table
,
VLC_BITS
,
3
);
pix
=
get_vlc2
(
&
gb
,
vlc
.
table
,
VLC_BITS
,
3
);
if
(
pix
<
0
)
{
if
(
pix
<
0
)
{
av_log
(
c
->
avctx
,
AV_LOG_ERROR
,
"Decoding error
\n
"
);
av_log
(
c
->
avctx
,
AV_LOG_ERROR
,
"Decoding error
\n
"
);
...
@@ -240,7 +239,7 @@ static int compute_cmask(int plane_no, int interlaced, enum AVPixelFormat pix_fm
...
@@ -240,7 +239,7 @@ static int compute_cmask(int plane_no, int interlaced, enum AVPixelFormat pix_fm
}
}
static
int
decode_plane
(
UtvideoContext
*
c
,
int
plane_no
,
static
int
decode_plane
(
UtvideoContext
*
c
,
int
plane_no
,
uint8_t
*
dst
,
int
step
,
ptrdiff_t
stride
,
uint8_t
*
dst
,
ptrdiff_t
stride
,
int
width
,
int
height
,
int
width
,
int
height
,
const
uint8_t
*
src
,
int
use_pred
)
const
uint8_t
*
src
,
int
use_pred
)
{
{
...
@@ -266,7 +265,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
...
@@ -266,7 +265,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
prev
=
0x80
;
prev
=
0x80
;
for
(
j
=
sstart
;
j
<
send
;
j
++
)
{
for
(
j
=
sstart
;
j
<
send
;
j
++
)
{
for
(
i
=
0
;
i
<
width
*
step
;
i
+=
step
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
pix
=
fsym
;
pix
=
fsym
;
if
(
use_pred
)
{
if
(
use_pred
)
{
prev
+=
pix
;
prev
+=
pix
;
...
@@ -310,8 +309,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
...
@@ -310,8 +309,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
prev
=
0x80
;
prev
=
0x80
;
for
(
j
=
sstart
;
j
<
send
;
j
++
)
{
for
(
j
=
sstart
;
j
<
send
;
j
++
)
{
int
ws
=
width
*
step
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
ws
;
i
+=
step
)
{
pix
=
get_vlc2
(
&
gb
,
vlc
.
table
,
VLC_BITS
,
3
);
pix
=
get_vlc2
(
&
gb
,
vlc
.
table
,
VLC_BITS
,
3
);
if
(
pix
<
0
)
{
if
(
pix
<
0
)
{
av_log
(
c
->
avctx
,
AV_LOG_ERROR
,
"Decoding error
\n
"
);
av_log
(
c
->
avctx
,
AV_LOG_ERROR
,
"Decoding error
\n
"
);
...
@@ -634,7 +632,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -634,7 +632,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case
AV_PIX_FMT_GBRP
:
case
AV_PIX_FMT_GBRP
:
case
AV_PIX_FMT_GBRAP
:
case
AV_PIX_FMT_GBRAP
:
for
(
i
=
0
;
i
<
c
->
planes
;
i
++
)
{
for
(
i
=
0
;
i
<
c
->
planes
;
i
++
)
{
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
1
,
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
frame
.
f
->
linesize
[
i
],
avctx
->
width
,
frame
.
f
->
linesize
[
i
],
avctx
->
width
,
avctx
->
height
,
plane_start
[
i
],
avctx
->
height
,
plane_start
[
i
],
c
->
frame_pred
==
PRED_LEFT
);
c
->
frame_pred
==
PRED_LEFT
);
...
@@ -671,7 +669,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -671,7 +669,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case
AV_PIX_FMT_GBRAP10
:
case
AV_PIX_FMT_GBRAP10
:
case
AV_PIX_FMT_GBRP10
:
case
AV_PIX_FMT_GBRP10
:
for
(
i
=
0
;
i
<
c
->
planes
;
i
++
)
{
for
(
i
=
0
;
i
<
c
->
planes
;
i
++
)
{
ret
=
decode_plane10
(
c
,
i
,
(
uint16_t
*
)
frame
.
f
->
data
[
i
],
1
,
ret
=
decode_plane10
(
c
,
i
,
(
uint16_t
*
)
frame
.
f
->
data
[
i
],
frame
.
f
->
linesize
[
i
]
/
2
,
avctx
->
width
,
frame
.
f
->
linesize
[
i
]
/
2
,
avctx
->
width
,
avctx
->
height
,
plane_start
[
i
],
avctx
->
height
,
plane_start
[
i
],
plane_start
[
i
+
1
]
-
1024
,
plane_start
[
i
+
1
]
-
1024
,
...
@@ -685,7 +683,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -685,7 +683,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break
;
break
;
case
AV_PIX_FMT_YUV420P
:
case
AV_PIX_FMT_YUV420P
:
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
1
,
frame
.
f
->
linesize
[
i
],
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
frame
.
f
->
linesize
[
i
],
avctx
->
width
>>
!!
i
,
avctx
->
height
>>
!!
i
,
avctx
->
width
>>
!!
i
,
avctx
->
height
>>
!!
i
,
plane_start
[
i
],
c
->
frame_pred
==
PRED_LEFT
);
plane_start
[
i
],
c
->
frame_pred
==
PRED_LEFT
);
if
(
ret
)
if
(
ret
)
...
@@ -717,7 +715,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -717,7 +715,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break
;
break
;
case
AV_PIX_FMT_YUV422P
:
case
AV_PIX_FMT_YUV422P
:
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
1
,
frame
.
f
->
linesize
[
i
],
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
frame
.
f
->
linesize
[
i
],
avctx
->
width
>>
!!
i
,
avctx
->
height
,
avctx
->
width
>>
!!
i
,
avctx
->
height
,
plane_start
[
i
],
c
->
frame_pred
==
PRED_LEFT
);
plane_start
[
i
],
c
->
frame_pred
==
PRED_LEFT
);
if
(
ret
)
if
(
ret
)
...
@@ -747,7 +745,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -747,7 +745,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break
;
break
;
case
AV_PIX_FMT_YUV444P
:
case
AV_PIX_FMT_YUV444P
:
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
1
,
frame
.
f
->
linesize
[
i
],
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
frame
.
f
->
linesize
[
i
],
avctx
->
width
,
avctx
->
height
,
avctx
->
width
,
avctx
->
height
,
plane_start
[
i
],
c
->
frame_pred
==
PRED_LEFT
);
plane_start
[
i
],
c
->
frame_pred
==
PRED_LEFT
);
if
(
ret
)
if
(
ret
)
...
@@ -777,7 +775,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -777,7 +775,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break
;
break
;
case
AV_PIX_FMT_YUV422P10
:
case
AV_PIX_FMT_YUV422P10
:
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
ret
=
decode_plane10
(
c
,
i
,
(
uint16_t
*
)
frame
.
f
->
data
[
i
],
1
,
frame
.
f
->
linesize
[
i
]
/
2
,
ret
=
decode_plane10
(
c
,
i
,
(
uint16_t
*
)
frame
.
f
->
data
[
i
],
frame
.
f
->
linesize
[
i
]
/
2
,
avctx
->
width
>>
!!
i
,
avctx
->
height
,
avctx
->
width
>>
!!
i
,
avctx
->
height
,
plane_start
[
i
],
plane_start
[
i
+
1
]
-
1024
,
c
->
frame_pred
==
PRED_LEFT
);
plane_start
[
i
],
plane_start
[
i
+
1
]
-
1024
,
c
->
frame_pred
==
PRED_LEFT
);
if
(
ret
)
if
(
ret
)
...
...
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