Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
e9655cf6
Commit
e9655cf6
authored
Mar 06, 2020
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16697 from alalek:imgcodecs_jpeg_drop_unnecessary_code
parents
094a5b0c
4a39b12a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
grfmt_jpeg.cpp
modules/imgcodecs/src/grfmt_jpeg.cpp
+15
-0
No files found.
modules/imgcodecs/src/grfmt_jpeg.cpp
View file @
e9655cf6
...
@@ -75,6 +75,17 @@ extern "C" {
...
@@ -75,6 +75,17 @@ extern "C" {
#include "jpeglib.h"
#include "jpeglib.h"
}
}
#ifndef CV_MANUAL_JPEG_STD_HUFF_TABLES
#if defined(LIBJPEG_TURBO_VERSION_NUMBER) && LIBJPEG_TURBO_VERSION_NUMBER >= 1003090
#define CV_MANUAL_JPEG_STD_HUFF_TABLES 0 // libjpeg-turbo handles standard huffman tables itself (jstdhuff.c)
#else
#define CV_MANUAL_JPEG_STD_HUFF_TABLES 1
#endif
#endif
#if CV_MANUAL_JPEG_STD_HUFF_TABLES == 0
#undef CV_MANUAL_JPEG_STD_HUFF_TABLES
#endif
namespace
cv
namespace
cv
{
{
...
@@ -252,6 +263,7 @@ bool JpegDecoder::readHeader()
...
@@ -252,6 +263,7 @@ bool JpegDecoder::readHeader()
return
result
;
return
result
;
}
}
#ifdef CV_MANUAL_JPEG_STD_HUFF_TABLES
/***************************************************************************
/***************************************************************************
* following code is for supporting MJPEG image files
* following code is for supporting MJPEG image files
* based on a message of Laurent Pinchart on the video4linux mailing list
* based on a message of Laurent Pinchart on the video4linux mailing list
...
@@ -385,6 +397,7 @@ int my_jpeg_load_dht (struct jpeg_decompress_struct *info, unsigned char *dht,
...
@@ -385,6 +397,7 @@ int my_jpeg_load_dht (struct jpeg_decompress_struct *info, unsigned char *dht,
* end of code for supportting MJPEG image files
* end of code for supportting MJPEG image files
* based on a message of Laurent Pinchart on the video4linux mailing list
* based on a message of Laurent Pinchart on the video4linux mailing list
***************************************************************************/
***************************************************************************/
#endif // CV_MANUAL_JPEG_STD_HUFF_TABLES
bool
JpegDecoder
::
readData
(
Mat
&
img
)
bool
JpegDecoder
::
readData
(
Mat
&
img
)
{
{
...
@@ -400,6 +413,7 @@ bool JpegDecoder::readData( Mat& img )
...
@@ -400,6 +413,7 @@ bool JpegDecoder::readData( Mat& img )
if
(
setjmp
(
jerr
->
setjmp_buffer
)
==
0
)
if
(
setjmp
(
jerr
->
setjmp_buffer
)
==
0
)
{
{
#ifdef CV_MANUAL_JPEG_STD_HUFF_TABLES
/* check if this is a mjpeg image format */
/* check if this is a mjpeg image format */
if
(
cinfo
->
ac_huff_tbl_ptrs
[
0
]
==
NULL
&&
if
(
cinfo
->
ac_huff_tbl_ptrs
[
0
]
==
NULL
&&
cinfo
->
ac_huff_tbl_ptrs
[
1
]
==
NULL
&&
cinfo
->
ac_huff_tbl_ptrs
[
1
]
==
NULL
&&
...
@@ -413,6 +427,7 @@ bool JpegDecoder::readData( Mat& img )
...
@@ -413,6 +427,7 @@ bool JpegDecoder::readData( Mat& img )
cinfo
->
ac_huff_tbl_ptrs
,
cinfo
->
ac_huff_tbl_ptrs
,
cinfo
->
dc_huff_tbl_ptrs
);
cinfo
->
dc_huff_tbl_ptrs
);
}
}
#endif
if
(
color
)
if
(
color
)
{
{
...
...
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