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
85bf478e
Commit
85bf478e
authored
Sep 14, 2002
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete aspect support
Originally committed as revision 944 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
590a6358
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
7 deletions
+42
-7
mjpeg.c
libavcodec/mjpeg.c
+42
-7
No files found.
libavcodec/mjpeg.c
View file @
85bf478e
...
...
@@ -16,8 +16,9 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Support for external huffman table and various fixes (AVID workaround) by
* Alex Beregszaszi <alex@naxine.org>
* Support for external huffman table, various fixes (AVID workaround),
* aspecting and various markers support
* by Alex Beregszaszi <alex@naxine.org>
*/
//#define DEBUG
#include "avcodec.h"
...
...
@@ -354,18 +355,39 @@ static void jpeg_put_comments(MpegEncContext *s)
int
size
;
UINT8
*
ptr
;
#if 0
if
(
s
->
aspect_ratio_info
)
{
/* JFIF header */
put_marker
(
p
,
APP0
);
put_bits
(
p
,
16
,
16
);
put_string
(
p
,
"JFIF"
);
/* this puts the trailing zero-byte too */
put_bits(p, 16, 0x
101);
put_bits
(
p
,
16
,
0x
0201
);
/* v 1.02 */
put_bits
(
p
,
8
,
0
);
/* units type: 0 - aspect ratio */
switch
(
s
->
aspect_ratio_info
)
{
case
FF_ASPECT_4_3_625
:
case
FF_ASPECT_4_3_525
:
put_bits
(
p
,
16
,
4
);
put_bits
(
p
,
16
,
3
);
break
;
case
FF_ASPECT_16_9_625
:
case
FF_ASPECT_16_9_525
:
put_bits
(
p
,
16
,
16
);
put_bits
(
p
,
16
,
9
);
break
;
case
FF_ASPECT_EXTENDED
:
put_bits
(
p
,
16
,
s
->
aspected_width
);
put_bits
(
p
,
16
,
s
->
aspected_height
);
break
;
case
FF_ASPECT_SQUARE
:
default:
put_bits
(
p
,
16
,
1
);
/* aspect: 1:1 */
put_bits
(
p
,
16
,
1
);
break
;
}
put_bits
(
p
,
8
,
0
);
/* thumbnail width */
put_bits
(
p
,
8
,
0
);
/* thumbnail height */
#endif
}
/* comment */
put_marker
(
p
,
COM
);
...
...
@@ -1084,6 +1106,19 @@ static int mjpeg_decode_app(MJpegDecodeContext *s,
skip_bits
(
&
s
->
gb
,
8
);
/* the trailing zero-byte */
printf
(
"mjpeg: JFIF header found (version: %x.%x)
\n
"
,
get_bits
(
&
s
->
gb
,
8
),
get_bits
(
&
s
->
gb
,
8
));
if
(
get_bits
(
&
s
->
gb
,
8
)
==
0
)
{
s
->
avctx
->
aspect_ratio_info
=
FF_ASPECT_EXTENDED
;
s
->
avctx
->
aspected_width
=
get_bits
(
&
s
->
gb
,
16
);
s
->
avctx
->
aspected_height
=
get_bits
(
&
s
->
gb
,
16
);
}
else
{
skip_bits
(
&
s
->
gb
,
16
);
skip_bits
(
&
s
->
gb
,
16
);
}
skip_bits
(
&
s
->
gb
,
8
);
skip_bits
(
&
s
->
gb
,
8
);
goto
out
;
}
...
...
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