Revision a6c01275

View differences:

libavcodec/ffv1.c
325 325
#endif
326 326
    
327 327
//printf("v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code, state->bias, state->error_sum, state->drift, state->count, k);
328
    set_sr_golomb_ffv1(pb, code, k, 12, bits);
328
    set_sr_golomb(pb, code, k, 12, bits);
329 329

  
330 330
    update_vlc_state(state, v);
331 331
}
......
342 342

  
343 343
    assert(k<=8);
344 344

  
345
    v= get_sr_golomb_ffv1(gb, k, 12, bits);
345
    v= get_sr_golomb(gb, k, 12, bits);
346 346
//printf("v:%d bias:%d error:%d drift:%d count:%d k:%d", v, state->bias, state->error_sum, state->drift, state->count, k);
347 347

  
348 348
#if 0 // JPEG LS
libavcodec/golomb.h
263 263
/**
264 264
 * read signed golomb rice code (ffv1).
265 265
 */
266
static inline int get_sr_golomb_ffv1(GetBitContext *gb, int k, int limit, int esc_len){
266
static inline int get_sr_golomb(GetBitContext *gb, int k, int limit, int esc_len){
267 267
    int v= get_ur_golomb(gb, k, limit, esc_len);
268 268
    
269 269
    v++;
......
272 272
    
273 273
//    return (v>>1) ^ -(v&1);
274 274
}
275
/**
276 275

  
276
/**
277 277
 * read signed golomb rice code (flac).
278 278
 */
279 279
static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, int esc_len){
......
281 281
    return (v>>1) ^ -(v&1);
282 282
}
283 283

  
284
/**
285
 * read signed golomb rice code (sonic).
286
 */
287
static inline int get_sr_golomb_sonic(GetBitContext *gb, int k, int limit, int esc_len){
288
    int v= get_ur_golomb(gb, k, limit, esc_len);
289
    
290
    v++;
291
    if (v&1) return -(v>>1);
292
    else return v>>1;
293
}
294

  
295 284
#ifdef TRACE
296 285

  
297 286
static inline int get_ue(GetBitContext *s, char *file, char *func, int line){
......
432 421
/**
433 422
 * write signed golomb rice code (ffv1).
434 423
 */
435
static inline void set_sr_golomb_ffv1(PutBitContext *pb, int i, int k, int limit, int esc_len){
424
static inline void set_sr_golomb(PutBitContext *pb, int i, int k, int limit, int esc_len){
436 425
    int v;
437 426

  
438 427
    v = -2*i-1;
......
452 441

  
453 442
    set_ur_golomb_jpegls(pb, v, k, limit, esc_len);
454 443
}
455

  
456
/**
457
 * write signed golomb rice code (sonic).
458
 */
459
static inline void set_sr_golomb_sonic(PutBitContext *pb, int i, int k, int limit, int esc_len){
460
    int v;
461

  
462
    v = 2*i-1;
463
    if (v<0) v ^= -1;
464

  
465
    set_ur_golomb(pb, v, k, limit, esc_len);
466
}

Also available in: Unified diff