Mercurial > libavcodec.hg
annotate rtjpeg.h @ 10061:09f2db2d7c90 libavcodec
Fix bug caused by difference in stride and picture width.
When a frame is allocated using libschroedinger routines, the frame data size
does not match the actual frame size if the width is not a multiple of 16. So
we cannot do a straightforward memcpy of the frame returned by libschroedinger
into the FFmpeg picture as the stride differs from the width.
Fix this bug by allocating for the libschroedinger frame with the dimensions
in AVCodecContext within libavcodec and passing the frame to libschroedinger.
patch by Anuradha Suraparaju, anuradha rd.bbc.co uk
| author | diego |
|---|---|
| date | Sat, 15 Aug 2009 11:59:53 +0000 |
| parents | 19c88aa29bec |
| children | 34a65026fa06 |
| rev | line source |
|---|---|
|
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
1 /* |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
2 * RTJpeg decoding functions |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
3 * copyright (c) 2006 Reimar Doeffinger |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
4 * |
|
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
5 * This file is part of FFmpeg. |
|
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
6 * |
|
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
|
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
|
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
|
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
11 * |
|
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
|
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
15 * Lesser General Public License for more details. |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
16 * |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
|
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3699
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
|
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
20 */ |
|
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3224
diff
changeset
|
21 |
| 7760 | 22 #ifndef AVCODEC_RTJPEG_H |
| 23 #define AVCODEC_RTJPEG_H | |
|
3224
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
24 |
| 5162 | 25 #include <stdint.h> |
| 6436 | 26 #include "dsputil.h" |
| 5162 | 27 |
|
3224
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
28 typedef struct { |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
29 int w, h; |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
30 DSPContext *dsp; |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
31 uint8_t scan[64]; |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
32 uint32_t lquant[64]; |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
33 uint32_t cquant[64]; |
|
9699
19c88aa29bec
Move "block" variable in rtjpeg decoder to context to ensure sufficient alignment
reimar
parents:
7760
diff
changeset
|
34 DECLARE_ALIGNED_16(DCTELEM, block[64]); |
|
3224
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
35 } RTJpegContext; |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
36 |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
37 void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
38 int width, int height, |
| 6298 | 39 const uint32_t *lquant, const uint32_t *cquant); |
|
3224
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
40 |
|
28aaf0a0135e
NuppelVideo/MythTVVideo support, including rtjpeg decoder
reimar
parents:
diff
changeset
|
41 int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, |
| 6298 | 42 const uint8_t *buf, int buf_size); |
| 7760 | 43 #endif /* AVCODEC_RTJPEG_H */ |
