Merge commit '10ba6ed3365615ed5c2995fe2d240cb2d5000173'

* commit '10ba6ed3365615ed5c2995fe2d240cb2d5000173': (32 commits)
  Travis: Install MacPorts without using macports-ci
  Build: Set FLOATTEST more intelligently
  BUILDING.md: Use min. iOS v8 in iOS Armv8 example
  Fix build if WITH_12BIT==1 && WITH_JPEG(7|8)==1
  Travis: Combine PPC/Arm tests with jpeg-7/8 tests
  Build: Fix test failures w/ Arm Neon SIMD exts
  Travis: Regression-test Armv8 and PPC SIMD exts
  Demote "fast" [I]DCT algorithms to legacy status
  jpegtran.c: "subarea" = "region"
  jpegtran.1: Minor formatting tweak
  transupp.c: Code formatting tweaks
  cdjpeg.h: Remove unused function stub
  Consistify formatting to simplify checkstyle
  README.ijg: Update URLs; remove Usenet info
  jversion.h: Update copyrights
  Build: Improve Arm 32-bit cross-comp./packaging
  "ARM"="Arm", "NEON"="Neon"
  Build: Fix permissions
  ChangeLog: Fix minor formatting issue
  ChangeLog.md: jpeg_crop_scanline(), not scanlines
  ...
This commit is contained in:
Kornel
2021-01-22 16:03:54 +00:00
222 changed files with 5007 additions and 3699 deletions

View File

@@ -236,10 +236,10 @@ static int getPixelFormat(int pixelSize, int flags)
return -1;
}
static int setCompDefaults(struct jpeg_compress_struct *cinfo, int pixelFormat,
int subsamp, int jpegQual, int flags)
static void setCompDefaults(struct jpeg_compress_struct *cinfo,
int pixelFormat, int subsamp, int jpegQual,
int flags)
{
int retval = 0;
#ifndef NO_GETENV
char *env = NULL;
#endif
@@ -308,8 +308,6 @@ static int setCompDefaults(struct jpeg_compress_struct *cinfo, int pixelFormat,
cinfo->comp_info[2].v_samp_factor = 1;
if (cinfo->num_components > 3)
cinfo->comp_info[3].v_samp_factor = tjMCUHeight[subsamp] / 8;
return retval;
}
@@ -685,8 +683,7 @@ DLLEXPORT int tjCompress2(tjhandle handle, const unsigned char *srcBuf,
alloc = 0; *jpegSize = tjBufSize(width, height, jpegSubsamp);
}
jpeg_mem_dest_tj(cinfo, jpegBuf, jpegSize, alloc);
if (setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual, flags) == -1)
return -1;
setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual, flags);
jpeg_start_compress(cinfo, TRUE);
for (i = 0; i < height; i++) {
@@ -781,7 +778,7 @@ DLLEXPORT int tjEncodeYUVPlanes(tjhandle handle, const unsigned char *srcBuf,
else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
#endif
if (setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags) == -1) return -1;
setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags);
/* Execute only the parts of jpeg_start_compress() that we need. If we
were to call the whole jpeg_start_compress() function, then it would try
@@ -995,8 +992,7 @@ DLLEXPORT int tjCompressFromYUVPlanes(tjhandle handle,
alloc = 0; *jpegSize = tjBufSize(width, height, subsamp);
}
jpeg_mem_dest_tj(cinfo, jpegBuf, jpegSize, alloc);
if (setCompDefaults(cinfo, TJPF_RGB, subsamp, jpegQual, flags) == -1)
return -1;
setCompDefaults(cinfo, TJPF_RGB, subsamp, jpegQual, flags);
cinfo->raw_data_in = TRUE;
jpeg_start_compress(cinfo, TRUE);