Merge commit '088f38a4f9f54bb923405c67c9e72d96d90aa284'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 1 May 2013 16:16:32 +0000 (18:16 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 1 May 2013 16:16:32 +0000 (18:16 +0200)
* commit '088f38a4f9f54bb923405c67c9e72d96d90aa284':
  avcodec: Drop unnecessary ff_ name prefixes from static functions

Conflicts:
libavcodec/ass.c
libavcodec/h264_parser.c
libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
13 files changed:
1  2 
libavcodec/ass.c
libavcodec/cavsdsp.c
libavcodec/dct.c
libavcodec/dsputil.c
libavcodec/fft.c
libavcodec/h261dec.c
libavcodec/h264_parser.c
libavcodec/mlpdsp.c
libavcodec/motion_est.c
libavcodec/mpegaudiodec.c
libavcodec/ra144.c
libavcodec/rdft.c
libavcodec/utils.c

@@@ -53,28 -69,28 +53,28 @@@ int ff_ass_subtitle_header(AVCodecConte
  
  int ff_ass_subtitle_header_default(AVCodecContext *avctx)
  {
 -    return ass_subtitle_header(avctx, ASS_DEFAULT_FONT,
 +    return ff_ass_subtitle_header(avctx, ASS_DEFAULT_FONT,
-                                          ASS_DEFAULT_FONT_SIZE,
-                                          ASS_DEFAULT_COLOR,
-                                          ASS_DEFAULT_BACK_COLOR,
-                                          ASS_DEFAULT_BOLD,
-                                          ASS_DEFAULT_ITALIC,
-                                          ASS_DEFAULT_UNDERLINE,
-                                          ASS_DEFAULT_ALIGNMENT);
+                                ASS_DEFAULT_FONT_SIZE,
+                                ASS_DEFAULT_COLOR,
+                                ASS_DEFAULT_BACK_COLOR,
+                                ASS_DEFAULT_BOLD,
+                                ASS_DEFAULT_ITALIC,
+                                ASS_DEFAULT_UNDERLINE,
+                                ASS_DEFAULT_ALIGNMENT);
  }
  
 -void ff_ass_init(AVSubtitle *sub)
 +static void insert_ts(AVBPrint *buf, int ts)
  {
 -    memset(sub, 0, sizeof(*sub));
 -}
 +    if (ts == -1) {
 +        av_bprintf(buf, "9:59:59.99,");
 +    } else {
 +        int h, m, s;
  
 -static int ts_to_string(char *str, int strlen, int ts)
 -{
 -    int h, m, s;
 -    h = ts/360000;  ts -= 360000*h;
 -    m = ts/  6000;  ts -=   6000*m;
 -    s = ts/   100;  ts -=    100*s;
 -    return snprintf(str, strlen, "%d:%02d:%02d.%02d", h, m, s, ts);
 +        h = ts/360000;  ts -= 360000*h;
 +        m = ts/  6000;  ts -=   6000*m;
 +        s = ts/   100;  ts -=    100*s;
 +        av_bprintf(buf, "%d:%02d:%02d.%02d,", h, m, s, ts);
 +    }
  }
  
  int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
Simple merge
Simple merge
@@@ -2696,31 -2550,15 +2696,31 @@@ av_cold void ff_dsputil_init(DSPContext
      }
  #endif //CONFIG_ENCODERS
  
 -    if (avctx->bits_per_raw_sample == 10) {
 -        c->idct_put              = ff_simple_idct_put_10;
 -        c->idct_add              = ff_simple_idct_add_10;
 -        c->idct                  = ff_simple_idct_10;
 -        c->idct_permutation_type = FF_NO_IDCT_PERM;
 -    } else {
 +    if(avctx->lowres==1){
 +        c->idct_put= ff_jref_idct4_put;
 +        c->idct_add= ff_jref_idct4_add;
 +        c->idct    = ff_j_rev_dct4;
 +        c->idct_permutation_type= FF_NO_IDCT_PERM;
 +    }else if(avctx->lowres==2){
 +        c->idct_put= ff_jref_idct2_put;
 +        c->idct_add= ff_jref_idct2_add;
 +        c->idct    = ff_j_rev_dct2;
 +        c->idct_permutation_type= FF_NO_IDCT_PERM;
 +    }else if(avctx->lowres==3){
 +        c->idct_put= ff_jref_idct1_put;
 +        c->idct_add= ff_jref_idct1_add;
 +        c->idct    = ff_j_rev_dct1;
 +        c->idct_permutation_type= FF_NO_IDCT_PERM;
 +    }else{
 +        if (avctx->bits_per_raw_sample == 10) {
 +            c->idct_put              = ff_simple_idct_put_10;
 +            c->idct_add              = ff_simple_idct_add_10;
 +            c->idct                  = ff_simple_idct_10;
 +            c->idct_permutation_type = FF_NO_IDCT_PERM;
 +        } else {
          if(avctx->idct_algo==FF_IDCT_INT){
-             c->idct_put= ff_jref_idct_put;
-             c->idct_add= ff_jref_idct_add;
+             c->idct_put= jref_idct_put;
+             c->idct_add= jref_idct_add;
              c->idct    = ff_j_rev_dct;
              c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
          }else if(avctx->idct_algo==FF_IDCT_FAAN){
Simple merge
Simple merge
  #include "golomb.h"
  #include "internal.h"
  
 -#include <assert.h>
 -
  
- static int ff_h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_size)
+ static int h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_size)
  {
 -    int i;
 +    int i, j;
      uint32_t state;
      ParseContext *pc = &h->parse_context;
 +    int next_avc= h->is_avc ? 0 : buf_size;
 +
  //    mb_addr= pc->mb_addr - 1;
      state= pc->state;
      if(state>13)
@@@ -322,8 -274,8 +322,8 @@@ static int h264_parse(AVCodecParserCont
          }
  
          if(next<0 && next != END_NOT_FOUND){
 -            assert(pc->last_index + next >= 0 );
 +            av_assert1(pc->last_index + next >= 0 );
-             ff_h264_find_frame_end(h, &pc->buffer[pc->last_index + next], -next); //update state
+             h264_find_frame_end(h, &pc->buffer[pc->last_index + next], -next); // update state
          }
      }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  #include <stdarg.h>
  #include <limits.h>
  #include <float.h>
 +#if CONFIG_ICONV
 +# include <iconv.h>
 +#endif
  
 +volatile int ff_avcodec_locked;
  static int volatile entangled_thread_counter = 0;
- static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op);
+ static int (*lockmgr_cb)(void **mutex, enum AVLockOp op);
  static void *codec_mutex;
  static void *avformat_mutex;
  
@@@ -3004,40 -2124,10 +3004,40 @@@ int av_lockmgr_register(int (*cb)(void 
      return 0;
  }
  
-     if (ff_lockmgr_cb) {
-         if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
 +int ff_lock_avcodec(AVCodecContext *log_ctx)
 +{
-     if (ff_lockmgr_cb) {
-         if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE))
++    if (lockmgr_cb) {
++        if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
 +            return -1;
 +    }
 +    entangled_thread_counter++;
 +    if (entangled_thread_counter != 1) {
 +        av_log(log_ctx, AV_LOG_ERROR, "Insufficient thread locking around avcodec_open/close()\n");
 +        ff_avcodec_locked = 1;
 +        ff_unlock_avcodec();
 +        return AVERROR(EINVAL);
 +    }
 +    av_assert0(!ff_avcodec_locked);
 +    ff_avcodec_locked = 1;
 +    return 0;
 +}
 +
 +int ff_unlock_avcodec(void)
 +{
 +    av_assert0(ff_avcodec_locked);
 +    ff_avcodec_locked = 0;
 +    entangled_thread_counter--;
++    if (lockmgr_cb) {
++        if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE))
 +            return -1;
 +    }
 +    return 0;
 +}
 +
  int avpriv_lock_avformat(void)
  {
-     if (ff_lockmgr_cb) {
-         if ((*ff_lockmgr_cb)(&avformat_mutex, AV_LOCK_OBTAIN))
+     if (lockmgr_cb) {
+         if ((*lockmgr_cb)(&avformat_mutex, AV_LOCK_OBTAIN))
              return -1;
      }
      return 0;