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
12a3156a
Commit
12a3156a
authored
Apr 23, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3955 from vpisarev:fixed_mjpeg_encoder
parents
dcf177e3
d825b7ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
cap.cpp
modules/videoio/src/cap.cpp
+2
-2
cap_mjpeg_encoder.cpp
modules/videoio/src/cap_mjpeg_encoder.cpp
+20
-1
No files found.
modules/videoio/src/cap.cpp
View file @
12a3156a
...
...
@@ -552,11 +552,11 @@ static Ptr<IVideoCapture> IVideoCapture_create(int index)
}
static
Ptr
<
IVideoCapture
>
IVideoCapture_create
(
const
String
&
)
static
Ptr
<
IVideoCapture
>
IVideoCapture_create
(
const
String
&
filename
)
{
Ptr
<
IVideoCapture
>
capture
;
//
capture = createMotionJpegCapture(filename);
capture
=
createMotionJpegCapture
(
filename
);
if
(
capture
&&
capture
->
isOpened
())
{
return
capture
;
...
...
modules/videoio/src/cap_mjpeg_encoder.cpp
View file @
12a3156a
...
...
@@ -248,6 +248,25 @@ public:
writeBlock
();
}
void
jflush
(
unsigned
currval
,
int
bitIdx
)
{
uchar
v
;
uchar
*
ptr
=
m_current
;
currval
|=
(
1
<<
bitIdx
)
-
1
;
while
(
bitIdx
<
32
)
{
v
=
(
uchar
)(
currval
>>
24
);
*
ptr
++
=
v
;
if
(
v
==
255
)
*
ptr
++
=
0
;
currval
<<=
8
;
bitIdx
+=
8
;
}
m_current
=
ptr
;
if
(
m_current
>=
m_end
)
writeBlock
();
}
static
bool
createEncodeHuffmanTable
(
const
int
*
src
,
unsigned
*
table
,
int
max_size
)
{
int
i
,
k
;
...
...
@@ -1440,7 +1459,7 @@ void MotionJpegWriter::writeFrameData( const uchar* data, int step, int colorspa
}
// Flush
JPUT_BITS
((
unsigned
)
-
1
,
bit_idx
&
31
);
strm
.
jflush
(
currval
,
bit_idx
);
strm
.
jputShort
(
0xFFD9
);
// EOI marker
/*printf("total dct = %.1fms, total cvt = %.1fms\n",
total_dct*1000./cv::getTickFrequency(),
...
...
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