Revision 735a3804

View differences:

libavcodec/libdirac_libschro.c
59 59
            avccontext->height == vf->height){
60 60
            ret_idx = idx;
61 61
            if (avccontext->time_base.den == vf->frame_rate_num &&
62
                avccontext->time_base.num == vf->frame_rate_denom) {
62
                avccontext->time_base.num == vf->frame_rate_denom)
63 63
                return idx;
64
            }
65 64
        }
66 65
    }
67 66
    return ret_idx;
......
76 75
void ff_dirac_schro_queue_free (FfmpegDiracSchroQueue *queue,
77 76
                                void (*free_func)(void *))
78 77
{
79
    while (queue->p_head) {
78
    while (queue->p_head)
80 79
        free_func( ff_dirac_schro_queue_pop(queue) );
81
    }
82 80
}
83 81

  
84 82
int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data)
libavcodec/libdiracdec.c
55 55
                      sizeof(ffmpeg_dirac_pixel_format_map[0]);
56 56
    int idx;
57 57

  
58
    for (idx = 0; idx < num_formats; ++idx) {
59
        if (ffmpeg_dirac_pixel_format_map[idx].dirac_pix_fmt == dirac_pix_fmt) {
58
    for (idx = 0; idx < num_formats; ++idx)
59
        if (ffmpeg_dirac_pixel_format_map[idx].dirac_pix_fmt == dirac_pix_fmt)
60 60
            return ffmpeg_dirac_pixel_format_map[idx].ff_pix_fmt;
61
        }
62
    }
63 61
    return PIX_FMT_NONE;
64 62
}
65 63

  
libavcodec/libdiracenc.c
188 188
                            avccontext->global_quality / (FF_QP2LAMBDA*10.0);
189 189
            /* if it is not default bitrate then send target rate. */
190 190
            if (avccontext->bit_rate >= 1000 &&
191
                avccontext->bit_rate != 200000) {
191
                avccontext->bit_rate != 200000)
192 192
               p_dirac_params->enc_ctx.enc_params.trate =
193 193
                             avccontext->bit_rate / 1000;
194
            }
195 194
        } else
196 195
            p_dirac_params->enc_ctx.enc_params.lossless = 1;
197 196
    } else if (avccontext->bit_rate >= 1000)
198 197
        p_dirac_params->enc_ctx.enc_params.trate = avccontext->bit_rate / 1000;
199 198

  
200 199
    if ((preset > VIDEO_FORMAT_QCIF || preset < VIDEO_FORMAT_QSIF525) &&
201
         avccontext->bit_rate == 200000) {
200
        avccontext->bit_rate == 200000)
202 201
        p_dirac_params->enc_ctx.enc_params.trate = 0;
203
    }
204 202

  
205
    if (avccontext->flags & CODEC_FLAG_INTERLACED_ME) {
203
    if (avccontext->flags & CODEC_FLAG_INTERLACED_ME)
206 204
        /* all material can be coded as interlaced or progressive
207 205
         * irrespective of the type of source material */
208 206
        p_dirac_params->enc_ctx.enc_params.picture_coding_mode = 1;
209
    }
210 207

  
211 208
    p_dirac_params->p_encoder = dirac_encoder_init (&(p_dirac_params->enc_ctx),
212 209
                                                    verbose );
libavcodec/libschroedingerdec.c
127 127
                      sizeof(ffmpeg_schro_pixel_format_map[0]);
128 128
    int idx;
129 129

  
130
    for (idx = 0; idx < num_formats; ++idx) {
131
        if (ffmpeg_schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt) {
130
    for (idx = 0; idx < num_formats; ++idx)
131
        if (ffmpeg_schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt)
132 132
            return ffmpeg_schro_pixel_format_map[idx].ff_pix_fmt;
133
        }
134
    }
135 133
    return PIX_FMT_NONE;
136 134
}
137 135

  
......
197 195
    avccontext->time_base.num = p_schro_params->format->frame_rate_denominator;
198 196

  
199 197
    if (!p_schro_params->dec_pic.data[0])
200
    {
201 198
        avpicture_alloc(&p_schro_params->dec_pic,
202 199
                        avccontext->pix_fmt,
203 200
                        avccontext->width,
204 201
                        avccontext->height);
205
    }
206 202
}
207 203

  
208 204
static int libschroedinger_decode_frame(AVCodecContext *avccontext,
......
277 273
            /* Pull a frame out of the decoder. */
278 274
            frame = schro_decoder_pull (decoder);
279 275

  
280
            if (frame) {
276
            if (frame)
281 277
                ff_dirac_schro_queue_push_back(
282 278
                                             &p_schro_params->dec_frame_queue,
283 279
                                             frame);
284
            }
285 280
            break;
286 281
        case SCHRO_DECODER_EOS:
287 282
            go = 0;
libavcodec/libschroedingerenc.c
150 150
                                          "gop_structure",
151 151
                                          SCHRO_ENCODER_GOP_INTRA_ONLY);
152 152

  
153
        if (avccontext->coder_type == FF_CODER_TYPE_VLC) {
153
        if (avccontext->coder_type == FF_CODER_TYPE_VLC)
154 154
            schro_encoder_setting_set_double (p_schro_params->encoder,
155 155
                                              "enable_noarith", 1);
156
        }
157 156
    }
158 157
    else {
159 158
        schro_encoder_setting_set_double (p_schro_params->encoder,
......
194 193

  
195 194
    }
196 195

  
197
    if (avccontext->flags & CODEC_FLAG_INTERLACED_ME) {
196
    if (avccontext->flags & CODEC_FLAG_INTERLACED_ME)
198 197
        /* All material can be coded as interlaced or progressive
199 198
           irrespective of the type of source material. */
200 199
        schro_encoder_setting_set_double (p_schro_params->encoder,
201 200
                                            "interlaced_coding", 1);
202
    }
203 201

  
204 202
    /* FIXME: Signal range hardcoded to 8-bit data until both libschroedinger
205 203
     * and libdirac support other bit-depth data. */
......
324 322
            p_frame_output->size     = p_schro_params->enc_buf_size;
325 323
            p_frame_output->p_encbuf = p_schro_params->enc_buf;
326 324
            if (SCHRO_PARSE_CODE_IS_INTRA(parse_code) &&
327
                SCHRO_PARSE_CODE_IS_REFERENCE(parse_code)) {
325
                SCHRO_PARSE_CODE_IS_REFERENCE(parse_code))
328 326
                p_frame_output->key_frame = 1;
329
            }
330 327

  
331 328
            /* Parse the coded frame number from the bitstream. Bytes 14
332 329
             * through 17 represesent the frame number. */

Also available in: Unified diff