~ubuntu-branches/ubuntu/vivid/libav/vivid

« back to all changes in this revision

Viewing changes to libavcodec/rtjpeg.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2013-10-22 23:24:08 UTC
  • mfrom: (1.3.36 sid)
  • Revision ID: package-import@ubuntu.com-20131022232408-b8tvvn4pyzri9mi3
Tags: 6:9.10-1ubuntu1
* Build all -extra flavors from this source package, as libav got demoted
  from main to universe, cf LP: #1243235
* Simplify debian/rules to follow exactly the code that debian executes
* New upstream (LP: #1180288) fixes lots of security issues (LP: #1242802)
* Merge from unstable, remaining changes:
  - build-depend on libtiff5-dev rather than libtiff4-dev,
    avoids FTBFS caused by imlib
  - follow the regular debian codepaths

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
 
98
98
/**
99
99
 * @brief decode one rtjpeg YUV420 frame
100
 
 * @param c context, must be initialized via rtjpeg_decode_init
 
100
 * @param c context, must be initialized via ff_rtjpeg_decode_init
101
101
 * @param f AVFrame to place decoded frame into. If parts of the frame
102
102
 *          are not coded they are left unchanged, so consider initializing it
103
103
 * @param buf buffer containing input data
104
104
 * @param buf_size length of input data in bytes
105
105
 * @return number of bytes consumed from the input buffer
106
106
 */
107
 
int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
108
 
                               const uint8_t *buf, int buf_size) {
 
107
int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
 
108
                                  const uint8_t *buf, int buf_size) {
109
109
    GetBitContext gb;
110
110
    int w = c->w / 16, h = c->h / 16;
111
 
    int x, y;
 
111
    int x, y, ret;
112
112
    uint8_t *y1 = f->data[0], *y2 = f->data[0] + 8 * f->linesize[0];
113
113
    uint8_t *u = f->data[1], *v = f->data[2];
114
 
    init_get_bits(&gb, buf, buf_size * 8);
 
114
 
 
115
    if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0)
 
116
        return ret;
 
117
 
115
118
    for (y = 0; y < h; y++) {
116
119
        for (x = 0; x < w; x++) {
117
120
#define BLOCK(quant, dst, stride) do { \
154
157
 * @param lquant luma quantization table to use
155
158
 * @param cquant chroma quantization table to use
156
159
 */
157
 
void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
158
 
                        int width, int height,
159
 
                        const uint32_t *lquant, const uint32_t *cquant) {
 
160
void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
 
161
                           int width, int height,
 
162
                           const uint32_t *lquant, const uint32_t *cquant) {
160
163
    int i;
161
164
    c->dsp = dsp;
162
165
    for (i = 0; i < 64; i++) {