Граф коммитов

20 Коммитов

Автор SHA1 Сообщение Дата
Kornel af265e7562 Merge tag '2.1.5'
* tag '2.1.5': (41 commits)
  BUILDING.md: Specify install prefix for MinGW/Un*x
  Java: Guard against int overflow in size methods
  turbojpeg.c: Fix UBSan warning
  tjPlane*(): Guard against int overflow
  Java doc: TJ.pixelSize --> TJ.getPixelSize()
  TJBench: Unset TJ*OPT_CROP when disabling tiling
  TJExample: Remove "underlying codec" references
  GitHub: Update to actions/checkout@v3
  TJBench: Set TJ*OPT_PROGRESSIVE with -progressive
  TJBench/Java: Fix parsing of quality ranges
  TJBench: Strictly check all non-boolean arguments
  TurboJPEG: More documentation improvements
  TJDecompressor.java: Exception message tweak
  12-bit: Set alpha channel to 4095 rather than 255
  TJDecompressor.java: "YUV" = "planar YUV"
  Java: Don't allow int overflow in buf size methods
  tjDecompressToYUV2: Use scaled dims for plane calc
  TurboJPEG: Numerous documentation improvements
  TurboJPEG: Don't use backward compatibility macros
  TurboJPEG: Ensure 'pad' arg is a power of 2
  ...
2023-02-03 20:54:24 +00:00
DRC eb0a024af2 Remove redundant jconfigint.h #includes
Because of 607b668ff9, jconfigint.h is
included by jinclude.h.
2022-10-04 12:51:52 -05:00
Kornel 5e797fa699 Merge tag '2.1.3' into master-moz
* tag '2.1.3': (56 commits)
  Neon/AArch64: Explicitly unroll quant loop w/Clang
  Neon/AArch64: Fix/suppress UBSan warnings
  Neon/AArch64: Accelerate Huffman encoding
  AppVeyor: Test strict MSVC compiler warnings
  Eliminate incompatible pointer type warnings
  MSVC: Eliminate int conversion warnings (C4244)
  MSVC: Eliminate C4996 warnings in API libs
  BUILDING.md: Clarify that Ninja works with Windows
  BUILDING.md: Remove NASM RPM rebuild instructions
  BUILDING.md: Document NASM/Yasm path variables
  "YASM" = "Yasm"
  Build: Fix Neon capability detection w/ MSVC
  Ensure that strncpy() dest strings are terminated
  Eliminate unnecessary JFREAD()/JFWRITE() macros
  Build: Embed version/API/(C) info in MSVC DLLs
  Fix segv w/ h2v2 merged upsamp, jpeg_crop_scanline
  TJBench: Remove innocuous always-true condition
  GitHub Actions: Specify Catalina for macOS build
  Fix -Wpedantic compiler warnings
  Eliminate non-ANSI C compatibility macros
  ...
2022-05-23 16:04:06 +01:00
DRC 172972394a Eliminate non-ANSI C compatibility macros
libjpeg-turbo has never supported non-ANSI C compilers.  Per the spec,
ANSI C compilers must have locale.h, stddef.h, stdlib.h, memset(),
memcpy(), unsigned char, and unsigned short.  They must also handle
undefined structures.
2022-01-06 11:50:26 -06:00
Peter Kasting 9df5786f05 Fix -Wimplicit-fallthrough warnings with Clang
The existing /*FALLTHROUGH*/ comments work with GCC but not Clang, so
this commit adds a FALLTHROUGH macro that uses the 'fallthrough'
attribute if the compiler supports it.

Refer to https://bugs.chromium.org/p/chromium/issues/detail?id=995993

NOTE: All versions of GCC that support -Wimplicit-fallthrough also
support the 'fallthrough' attribute, but certain other compilers (Oracle
Solaris Studio, for instance) support /*FALLTHROUGH*/ but not the
'fallthrough' attribute.  Thus, this commit retains the /*FALLTHROUGH*/
comments, which have existed in the libjpeg code base in some form since
1994 (libjpeg v5.)

Closes #531
2021-07-06 12:37:34 -05:00
DRC 19c791cdac Improve code formatting consistency
With rare exceptions ...
- Always separate line continuation characters by one space from
  preceding code.
- Always use two-space indentation.  Never use tabs.
- Always use K&R-style conditional blocks.
- Always surround operators with spaces, except in raw assembly code.
- Always put a space after, but not before, a comma.
- Never put a space between type casts and variables/function calls.
- Never put a space between the function name and the argument list in
  function declarations and prototypes.
- Always surround braces ('{' and '}') with spaces.
- Always surround statements (if, for, else, catch, while, do, switch)
  with spaces.
- Always attach pointer symbols ('*' and '**') to the variable or
  function name.
- Always precede pointer symbols ('*' and '**') by a space in type
  casts.
- Use the MIN() macro from jpegint.h within the libjpeg and TurboJPEG
  API libraries (using min() from tjutil.h is still necessary for
  TJBench.)
- Where it makes sense (particularly in the TurboJPEG code), put a blank
  line after variable declaration blocks.
- Always separate statements in one-liners by two spaces.

The purpose of this was to ease maintenance on my part and also to make
it easier for contributors to figure out how to format patch
submissions.  This was admittedly confusing (even to me sometimes) when
we had 3 or 4 different style conventions in the same source tree.  The
new convention is more consistent with the formatting of other OSS code
bases.

This commit corrects deviations from the chosen formatting style in the
libjpeg API code and reformats the TurboJPEG API code such that it
conforms to the same standard.

NOTES:
- Although it is no longer necessary for the function name in function
  declarations to begin in Column 1 (this was historically necessary
  because of the ansi2knr utility, which allowed libjpeg to be built
  with non-ANSI compilers), we retain that formatting for the libjpeg
  code because it improves readability when using libjpeg's function
  attribute macros (GLOBAL(), etc.)
- This reformatting project was accomplished with the help of AStyle and
  Uncrustify, although neither was completely up to the task, and thus
  a great deal of manual tweaking was required.  Note to developers of
  code formatting utilities:  the libjpeg-turbo code base is an
  excellent test bed, because AFAICT, it breaks every single one of the
  utilities that are currently available.
- The legacy (MMX, SSE, 3DNow!) assembly code for i386 has been
  formatted to match the SSE2 code (refer to
  ff5685d5344273df321eb63a005eaae19d2496e3.)  I hadn't intended to
  bother with this, but the Loongson MMI implementation demonstrated
  that there is still academic value to the MMX implementation, as an
  algorithmic model for other 64-bit vector implementations.  Thus, it
  is desirable to improve its readability in the same manner as that of
  the SSE2 implementation.
2018-03-16 02:14:34 -05:00
Kornel Lesiński ec333d5bbd Merge remote-tracking branch 'libjpeg-turbo/master' into libjpeg-turbo
* libjpeg-turbo/master: (140 commits)
  Increase severity of tjDecompressToYUV2() bug desc
  Catch libjpeg errors in tjDecompressToYUV2()
  BUILDING.md: Fix "... OR ..." indentation again
  BUILDING.md: Fix confusing Windows build reqs
  ChangeLog.md: Improve readability of plain text
  change.log: Refer users to ChangeLog.md
  Markdown version of ChangeLog.txt
  Rename ChangeLog.txt
  README.md: Link to BUILDING.md
  BUILDING.md and README.md: Cosmetic tweaks
  ChangeLog: "1.5 beta1" --> "1.4.90 (1.5 beta1)"
  Java: Fix parallel make with autotools
  Win/x64: Fix improper callee save of xmm8-xmm11
  Bump TurboJPEG C API revision to 1.5
  ChangeLog: Mention jpeg_crop_scanline() function
  1.5 beta1
  Fix v7/v8-compatible build
  libjpeg API: Partial scanline decompression
  Build: Make the NASM autoconf variable persistent
  Use consistent/modern code formatting for dbl ptrs
  ...
2016-04-28 01:08:01 +01:00
DRC 3ab68cf563 libjpeg API: Partial scanline decompression
This, in combination with the existing jpeg_skip_scanlines() function,
provides the ability to crop the image both horizontally and vertically
while decompressing (certain restrictions apply-- see libjpeg.txt.)

This also cleans up the documentation of the line skipping feature and
removes the "strip decompression" feature from djpeg, since the new
cropping feature is a superset of it.

Refer to #34 for discussion.

Closes #34
2016-02-19 21:07:39 -06:00
DRC 7e3acc0e0a Rename README, LICENSE, BUILDING text files
The IJG README file has been renamed to README.ijg, in order to avoid
confusion (many people were assuming that that was our project's README
file and weren't reading README-turbo.txt) and to lay the groundwork for
markdown versions of the libjpeg-turbo README and build instructions.
2015-10-10 10:31:33 -05:00
Kornel Lesiński 67753d1298 Const on simple getters and copy source 2015-01-24 16:28:29 +00:00
DRC 46611eb0ee libjpeg-turbo has never supported non-ANSI compilers, so get rid of the crufty SIZEOF() macro. It was not being used consistently anyhow, so it would not have been possible to build prior releases of libjpeg-turbo using the broken compilers for which that macro was designed. 2014-05-18 19:04:03 +00:00
DRC 5de454b291 libjpeg-turbo has never supported non-ANSI compilers, so get rid of the crufty SIZEOF() macro. It was not being used consistently anyhow, so it would not have been possible to build prior releases of libjpeg-turbo using the broken compilers for which that macro was designed.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1313 632fc199-4ca6-4c93-a231-07263d6284db
2014-05-18 19:04:03 +00:00
DRC e45363d7c2 Convert tabs to spaces in the libjpeg code and the SIMD code (TurboJPEG retains the use of tabs for historical reasons. They were annoying in the libjpeg code primarily because they were not consistently used and because they were used to format as well as indent the code. In the case of TurboJPEG, tabs are used just to indent the code, so even if the editor assumes a different tab width, the code will still be readable.) 2014-05-09 18:00:32 +00:00
DRC e5eaf37440 Convert tabs to spaces in the libjpeg code and the SIMD code (TurboJPEG retains the use of tabs for historical reasons. They were annoying in the libjpeg code primarily because they were not consistently used and because they were used to format as well as indent the code. In the case of TurboJPEG, tabs are used just to indent the code, so even if the editor assumes a different tab width, the code will still be readable.)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1278 632fc199-4ca6-4c93-a231-07263d6284db
2014-05-09 18:00:32 +00:00
Thomas G. Lane 5ead57a34a The Independent JPEG Group's JPEG software v6b 2015-07-27 13:43:00 -05:00
Thomas G. Lane 489583f516 The Independent JPEG Group's JPEG software v6a 2015-07-29 15:32:35 -05:00
Thomas G. Lane bc79e0680a The Independent JPEG Group's JPEG software v6 2015-07-29 15:31:30 -05:00
Thomas G. Lane 41f55c093a The Independent JPEG Group's JPEG software v6b 2014-09-07 20:00:00 +01:00
Thomas G. Lane 16c97143f3 The Independent JPEG Group's JPEG software v6a 2014-09-07 20:00:00 +01:00
Thomas G. Lane 0baf670330 The Independent JPEG Group's JPEG software v6 2014-09-07 20:00:00 +01:00