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
64774492
Commit
64774492
authored
Feb 08, 2014
by
Kostya Shishkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g2meet: make JPEG tile decoder operate on 8x8 block mask
This is needed for upcoming Go2Meeting (G2M2/G2M3) decoder.
parent
d6d78518
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
g2meet.c
libavcodec/g2meet.c
+16
-7
No files found.
libavcodec/g2meet.c
View file @
64774492
...
@@ -253,19 +253,25 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
...
@@ -253,19 +253,25 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
mb_h
=
(
height
+
15
)
>>
4
;
mb_h
=
(
height
+
15
)
>>
4
;
if
(
!
num_mbs
)
if
(
!
num_mbs
)
num_mbs
=
mb_w
*
mb_h
;
num_mbs
=
mb_w
*
mb_h
*
4
;
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
c
->
prev_dc
[
i
]
=
1024
;
c
->
prev_dc
[
i
]
=
1024
;
bx
=
by
=
0
;
bx
=
by
=
0
;
c
->
dsp
.
clear_blocks
(
c
->
block
[
0
]);
for
(
mb_y
=
0
;
mb_y
<
mb_h
;
mb_y
++
)
{
for
(
mb_y
=
0
;
mb_y
<
mb_h
;
mb_y
++
)
{
for
(
mb_x
=
0
;
mb_x
<
mb_w
;
mb_x
++
)
{
for
(
mb_x
=
0
;
mb_x
<
mb_w
;
mb_x
++
)
{
if
(
mask
&&
!
mask
[
mb_x
])
{
if
(
mask
&&
!
mask
[
mb_x
*
2
]
&&
!
mask
[
mb_x
*
2
+
1
]
&&
!
mask
[
mb_x
*
2
+
mask_stride
]
&&
!
mask
[
mb_x
*
2
+
1
+
mask_stride
])
{
bx
+=
16
;
bx
+=
16
;
continue
;
continue
;
}
}
for
(
j
=
0
;
j
<
2
;
j
++
)
{
for
(
j
=
0
;
j
<
2
;
j
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
if
(
mask
&&
!
mask
[
mb_x
*
2
+
i
+
j
*
mask_stride
])
continue
;
num_mbs
--
;
if
((
ret
=
jpg_decode_block
(
c
,
&
gb
,
0
,
if
((
ret
=
jpg_decode_block
(
c
,
&
gb
,
0
,
c
->
block
[
i
+
j
*
2
]))
!=
0
)
c
->
block
[
i
+
j
*
2
]))
!=
0
)
return
ret
;
return
ret
;
...
@@ -290,14 +296,14 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
...
@@ -290,14 +296,14 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
}
}
}
}
if
(
!
--
num_mbs
)
if
(
!
num_mbs
)
return
0
;
return
0
;
bx
+=
16
;
bx
+=
16
;
}
}
bx
=
0
;
bx
=
0
;
by
+=
16
;
by
+=
16
;
if
(
mask
)
if
(
mask
)
mask
+=
mask_stride
;
mask
+=
mask_stride
*
2
;
}
}
return
0
;
return
0
;
...
@@ -403,7 +409,7 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
...
@@ -403,7 +409,7 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
nblocks
=
*
src
++
+
1
;
nblocks
=
*
src
++
+
1
;
cblocks
=
0
;
cblocks
=
0
;
bstride
=
FFALIGN
(
width
,
16
)
>>
4
;
bstride
=
FFALIGN
(
width
,
16
)
>>
3
;
// blocks are coded LSB and we need normal bitreader for JPEG data
// blocks are coded LSB and we need normal bitreader for JPEG data
bits
=
0
;
bits
=
0
;
for
(
i
=
0
;
i
<
(
FFALIGN
(
height
,
16
)
>>
4
);
i
++
)
{
for
(
i
=
0
;
i
<
(
FFALIGN
(
height
,
16
)
>>
4
);
i
++
)
{
...
@@ -418,14 +424,17 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
...
@@ -418,14 +424,17 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
cblocks
+=
coded
;
cblocks
+=
coded
;
if
(
cblocks
>
nblocks
)
if
(
cblocks
>
nblocks
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
c
->
kempf_flags
[
j
+
i
*
bstride
]
=
coded
;
c
->
kempf_flags
[
j
*
2
+
i
*
2
*
bstride
]
=
c
->
kempf_flags
[
j
*
2
+
1
+
i
*
2
*
bstride
]
=
c
->
kempf_flags
[
j
*
2
+
(
i
*
2
+
1
)
*
bstride
]
=
c
->
kempf_flags
[
j
*
2
+
1
+
(
i
*
2
+
1
)
*
bstride
]
=
coded
;
}
}
}
}
memset
(
c
->
jpeg_tile
,
0
,
c
->
tile_stride
*
height
);
memset
(
c
->
jpeg_tile
,
0
,
c
->
tile_stride
*
height
);
jpg_decode_data
(
&
c
->
jc
,
width
,
height
,
src
,
src_end
-
src
,
jpg_decode_data
(
&
c
->
jc
,
width
,
height
,
src
,
src_end
-
src
,
c
->
jpeg_tile
,
c
->
tile_stride
,
c
->
jpeg_tile
,
c
->
tile_stride
,
c
->
kempf_flags
,
bstride
,
nblocks
,
0
);
c
->
kempf_flags
,
bstride
,
nblocks
*
4
,
0
);
kempf_restore_buf
(
c
->
kempf_buf
,
dlen
,
dst
,
c
->
framebuf_stride
,
kempf_restore_buf
(
c
->
kempf_buf
,
dlen
,
dst
,
c
->
framebuf_stride
,
c
->
jpeg_tile
,
c
->
tile_stride
,
c
->
jpeg_tile
,
c
->
tile_stride
,
...
...
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