--- config.h	Tue Mar 22 17:30:29 2016
+++ config.h	Mon Jan 12 01:17:07 2015
@@ -155,7 +155,7 @@
 #define HAVE_ATOMICS_SUNCC 0
 #define HAVE_ATOMICS_WIN32 0
 #define HAVE_ATOMIC_CAS_PTR 0
-#define HAVE_ATOMIC_COMPARE_EXCHANGE 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
 #define HAVE_MACHINE_RW_BARRIER 0
 #define HAVE_MEMORYBARRIER 0
 #define HAVE_MM_EMPTY 1
--- Makefile	Tue Mar 22 17:35:02 2016
+++ Makefile	Mon Jan 12 01:17:07 2015
@@ -45,7 +45,6 @@
 ifdef USE_JCTVC_HIGH_BIT_DEPTH
 CFLAGS+=-DRExt__HIGH_BIT_DEPTH_SUPPORT
 endif
-CFLAGS+=-fPIC
 
 # Emscriptem config
 EMLDFLAGS:=-s "EXPORTED_FUNCTIONS=['_bpg_decoder_open','_bpg_decoder_decode','_bpg_decoder_get_info','_bpg_decoder_start','_bpg_decoder_get_frame_duration','_bpg_decoder_get_line','_bpg_decoder_close','_malloc','_free']"
@@ -159,9 +158,6 @@
 libbpg.a: $(LIBBPG_OBJS) 
 	$(AR) rcs $@ $^
 
-libbpg.so: $(LIBBPG_OBJS) 
-	$(CC) -shared -o $@ $^
-
 bpgdec$(EXE): bpgdec.o libbpg.a
 	$(CC) $(LDFLAGS) -o $@ $^ $(BPGDEC_LIBS)
 
@@ -192,7 +188,7 @@
      jctvc jctvc/TLibEncoder jctvc/TLibVideoIO jctvc/TLibCommon jctvc/libmd5
 
 clean:
-	rm -f $(PROGS) *.o *.a *.so *.d *~ $(addsuffix /*.o, $(CLEAN_DIRS)) \
+	rm -f $(PROGS) *.o *.a *.d *~ $(addsuffix /*.o, $(CLEAN_DIRS)) \
           $(addsuffix /*.d, $(CLEAN_DIRS)) $(addsuffix /*~, $(CLEAN_DIRS)) \
           $(addsuffix /*.a, $(CLEAN_DIRS))
 
--- libavcodec/hevc.c	Tue Mar 22 17:30:29 2016
+++ libavcodec/hevc.c	Mon Jan 12 01:17:07 2015
@@ -39,11 +39,7 @@
 #include "golomb.h"
 #include "hevc.h"
 
-const uint8_t ff_hevc_pel_weight[65] = /*{ [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 };*/
-	//0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
-	{ 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7,
-	//  33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64
-	     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 };
+const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 };
 
 /**
  * NOTE: Each function hls_foo correspond to the function foo in the
@@ -3634,36 +3630,19 @@
 #endif
 
 AVCodec ff_hevc_decoder = {
-    /*.name                  = */"hevc",
-    /*.long_name             = */NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"),
-    /*.type                  = */AVMEDIA_TYPE_VIDEO,
-    /*.id                    = */AV_CODEC_ID_HEVC,
-    /*.capabilities          = */CODEC_CAP_DR1 | CODEC_CAP_DELAY |
-                             CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS,
-	/*.supported_framerates*/ 0,
-	/*.pix_fmts*/ 0,
-	/*.supported_samplerates*/ 0,
-	/*.sample_fmts*/ 0,
-	/*.channel_layouts*/ 0,
-#if FF_API_LOWRES
-	/*.max_lowres*/ 0,
-#endif
+    .name                  = "hevc",
+    .long_name             = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"),
+    .type                  = AVMEDIA_TYPE_VIDEO,
+    .id                    = AV_CODEC_ID_HEVC,
+    .priv_data_size        = sizeof(HEVCContext),
     //    .priv_class            = &hevc_decoder_class,
-	/*.priv_class*/ 0,
-    //    .profiles              = NULL_IF_CONFIG_SMALL(profiles),
-	/*.profiles*/ 0,
-	/*.priv_data_size        = */sizeof(HEVCContext),
-	/*.next*/ 0,
-    //    .init_thread_copy      = hevc_init_thread_copy,
-	/*.init_thread_copy*/ 0,
+    .init                  = hevc_decode_init,
+    .close                 = hevc_decode_free,
+    .decode                = hevc_decode_frame,
+    .flush                 = hevc_decode_flush,
     //    .update_thread_context = hevc_update_thread_context,
-	/*.update_thread_context*/ 0,
-	/*.defaults*/ 0,
-	/*.init_static_data*/ 0,
-    /*.init                  = */hevc_decode_init,
-	/*.encode_sub*/ 0,
-	/*.encode2*/ 0,
-    /*.decode                = */hevc_decode_frame,
-    /*.close                 = */hevc_decode_free,
-    /*.flush                 = */hevc_decode_flush,
+    //    .init_thread_copy      = hevc_init_thread_copy,
+    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
+                             CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS,
+    //    .profiles              = NULL_IF_CONFIG_SMALL(profiles),
 };
--- libavcodec/hevc_ps.c	Tue Mar 22 17:30:29 2016
+++ libavcodec/hevc_ps.c	Mon Jan 12 01:17:07 2015
@@ -742,7 +742,6 @@
 
 int ff_hevc_decode_nal_sps(HEVCContext *s)
 {
-	const AVRational rational = { 0, 1 };
     const AVPixFmtDescriptor *desc;
     GetBitContext *gb = &s->HEVClc->gb;
     int ret = 0;
@@ -1098,7 +1097,7 @@
     sps->long_term_ref_pics_present_flag = 0; /* not used for intra */
     sps->sps_temporal_mvp_enabled_flag = 1; /* not used for intra */
     sps->sps_strong_intra_smoothing_enable_flag = get_bits1(gb);
-    sps->vui.sar = rational;
+    sps->vui.sar = (AVRational){0, 1};
 #else
     sps->nb_st_rps = get_ue_golomb_long(gb);
     if (sps->nb_st_rps > MAX_SHORT_TERM_RPS_COUNT) {
--- libavcodec/hevcdsp.c	Tue Mar 22 17:30:29 2016
+++ libavcodec/hevcdsp.c	Mon Jan 12 01:17:07 2015
@@ -320,8 +320,6 @@
     }
 #endif /* USE_VAR_BIT_DEPTH */
 
-#if ARCH_X86
     if (ARCH_X86)
         ff_hevc_dsp_init_x86(hevcdsp, bit_depth);
-#endif
 }
--- libavcodec/internal.h	Tue Mar 22 17:30:29 2016
+++ libavcodec/internal.h	Mon Jan 12 01:17:07 2015
@@ -195,10 +195,9 @@
 static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx,
                                                         int64_t samples)
 {
-	const AVRational rational = { 1, avctx->sample_rate };
     if(samples == AV_NOPTS_VALUE)
         return AV_NOPTS_VALUE;
-    return av_rescale_q(samples, rational,
+    return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate },
                         avctx->time_base);
 }
 
--- libavcodec/utils.c	Tue Mar 22 17:30:29 2016
+++ libavcodec/utils.c	Mon Jan 12 01:17:07 2015
@@ -167,21 +167,20 @@
 
 int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
 {
-	const AVRational rational = { 0, 1 };
     memset(s, 0, sizeof(AVCodecContext));
 
     s->codec_type = codec ? codec->type : AVMEDIA_TYPE_UNKNOWN;
     if (codec)
         s->codec_id = codec->id;
 
-    s->time_base           = rational;
-    s->framerate           = rational;
-    s->pkt_timebase        = rational;
+    s->time_base           = (AVRational){0,1};
+    s->framerate           = (AVRational){ 0, 1 };
+    s->pkt_timebase        = (AVRational){ 0, 1 };
     s->get_buffer2         = avcodec_default_get_buffer2;
     //    s->get_format          = avcodec_default_get_format;
     s->execute             = avcodec_default_execute;
     s->execute2            = avcodec_default_execute2;
-    s->sample_aspect_ratio = rational;
+    s->sample_aspect_ratio = (AVRational){0,1};
     s->pix_fmt             = AV_PIX_FMT_NONE;
     s->sample_fmt          = AV_SAMPLE_FMT_NONE;
 
--- libavcodec/videodsp.c	Tue Mar 22 17:30:29 2016
+++ libavcodec/videodsp.c	Mon Jan 12 01:17:07 2015
@@ -63,22 +63,14 @@
 #endif
 #endif /* !USE_FULL */
 
-#if ARCH_AARCH64
     if (ARCH_AARCH64)
         ff_videodsp_init_aarch64(ctx, bpc);
-#endif
-#if ARCH_ARM
     if (ARCH_ARM)
         ff_videodsp_init_arm(ctx, bpc);
-#endif
-#if ARCH_PPC
     if (ARCH_PPC)
         ff_videodsp_init_ppc(ctx, bpc);
-#endif
-#if ARCH_X86
     if (ARCH_X86)
         ff_videodsp_init_x86(ctx, bpc);
-#endif
 }
 
 #endif
--- libavutil/frame.c	Tue Mar 22 17:30:27 2016
+++ libavutil/frame.c	Mon Jan 12 01:17:07 2015
@@ -45,7 +45,6 @@
 
 static void get_frame_defaults(AVFrame *frame)
 {
-	const AVRational rational = { 0, 1 };
     memset(frame, 0, sizeof(*frame));
 
     frame->pts                   =
@@ -56,7 +55,7 @@
     av_frame_set_pkt_pos              (frame, -1);
     av_frame_set_pkt_size             (frame, -1);
     frame->key_frame           = 1;
-    frame->sample_aspect_ratio = rational;
+    frame->sample_aspect_ratio = (AVRational){ 0, 1 };
     frame->format              = -1; /* unknown */
     frame->color_primaries     = AVCOL_PRI_UNSPECIFIED;
     frame->color_trc           = AVCOL_TRC_UNSPECIFIED;
--- libavutil/internal.h	Tue Mar 22 17:30:27 2016
+++ libavutil/internal.h	Mon Jan 12 01:17:07 2015
@@ -168,8 +168,8 @@
 #include "libm.h"
 
 #if defined(_MSC_VER)
-//#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_strtod")
-//#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_snprintf")
+#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_strtod")
+#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_snprintf")
 #endif
 
 /**
--- libavutil/intmath.h	Tue Mar 22 17:30:27 2016
+++ libavutil/intmath.h	Mon Jan 12 01:17:07 2015
@@ -57,7 +57,7 @@
 
 #ifndef ff_log2
 #define ff_log2 ff_log2_c
-#if !defined( _MSC_VER ) || defined(UNDER_CE)
+#if !defined( _MSC_VER )
 static av_always_inline av_const int ff_log2_c(unsigned int v)
 {
     int n = 0;
@@ -125,7 +125,7 @@
 
 #ifndef ff_ctz
 #define ff_ctz ff_ctz_c
-#if !defined( _MSC_VER ) || defined(UNDER_CE)
+#if !defined( _MSC_VER )
 static av_always_inline av_const int ff_ctz_c(int v)
 {
     int c;
--- libavutil/pixdesc.c	Tue Mar 22 17:30:25 2016
+++ libavutil/pixdesc.c	Mon Jan 12 01:17:07 2015
@@ -43,61 +43,54 @@
         AV_PIX_FMT_YUV420P16LE,
         {
             //.name = "yuv420p16le",
-			/*.name*/ 0,
-            /*.nb_components =*/ 3,
-            /*.log2_chroma_w =*/ 1,
-            /*.log2_chroma_h =*/ 1,
-			/*.flags*/ 0,
-            /*.comp =*/ {
+            .nb_components = 3,
+            .log2_chroma_w = 1,
+            .log2_chroma_h = 1,
+            .comp = {
                 { 0, 1, 1, 0, 15 },        /* Y */
                 { 1, 1, 1, 0, 15 },        /* U */
                 { 2, 1, 1, 0, 15 },        /* V */
             },
-			/*alias*/ 0
         }
     },
     {
         AV_PIX_FMT_YUV422P16LE,
         {
             //.name = "yuv422p16le",
-			/*.name*/ 0,
-            /*.nb_components =*/ 3,
-            /*.log2_chroma_w =*/ 1,
-            /*.log2_chroma_h =*/ 0,
-			/*.flags*/ AV_PIX_FMT_FLAG_PLANAR,
-            /*.comp =*/ {
+            .nb_components = 3,
+            .log2_chroma_w = 1,
+            .log2_chroma_h = 0,
+            .comp = {
                 { 0, 1, 1, 0, 15 },        /* Y */
                 { 1, 1, 1, 0, 15 },        /* U */
                 { 2, 1, 1, 0, 15 },        /* V */
             },
+            .flags = AV_PIX_FMT_FLAG_PLANAR,
         }
     },
     {
         AV_PIX_FMT_YUV444P16LE,
         {
             //.name = "yuv444p16le",
-			/*.name*/ 0,
-            /*.nb_components =*/ 3,
-            /*.log2_chroma_w =*/ 0,
-            /*.log2_chroma_h =*/ 0,
-			/*.flags*/ AV_PIX_FMT_FLAG_PLANAR,
-            /*.comp =*/ {
+            .nb_components = 3,
+            .log2_chroma_w = 0,
+            .log2_chroma_h = 0,
+            .comp = {
                 { 0, 1, 1, 0, 15 },        /* Y */
                 { 1, 1, 1, 0, 15 },        /* U */
                 { 2, 1, 1, 0, 15 },        /* V */
             },
+            .flags = AV_PIX_FMT_FLAG_PLANAR,
         }
     },
     {
         AV_PIX_FMT_GRAY16LE,
         {
             //.name = "gray16le",
-			/*.name*/ 0,
-            /*.nb_components =*/ 1,
-            /*.log2_chroma_w =*/ 0,
-            /*.log2_chroma_h =*/ 0,
-			/*.flags*/ 0,
-            /*.comp =*/ {
+            .nb_components = 1,
+            .log2_chroma_w = 0,
+            .log2_chroma_h = 0,
+            .comp = {
                 { 0, 1, 1, 0, 15 },       /* Y */
             },
             //.alias = "y16le",
@@ -108,12 +101,10 @@
         AV_PIX_FMT_YUV420P,
         {
             //.name = "yuv420p",
-			/*.name*/ 0,
-            /*.nb_components =*/ 3,
-            /*.log2_chroma_w =*/ 1,
-            /*.log2_chroma_h =*/ 1,
-			/*.flags*/ 0,
-            /*.comp =*/ {
+            .nb_components = 3,
+            .log2_chroma_w = 1,
+            .log2_chroma_h = 1,
+            .comp = {
                 { 0, 1, 1, 0, 7 },        /* Y */
                 { 1, 1, 1, 0, 7 },        /* U */
                 { 2, 1, 1, 0, 7 },        /* V */
@@ -124,44 +115,40 @@
         AV_PIX_FMT_YUV422P,
         {
             //.name = "yuv422p",
-			/*.name*/ 0,
-            /*.nb_components =*/ 3,
-            /*.log2_chroma_w =*/ 1,
-            /*.log2_chroma_h =*/ 0,
-			/*.flags*/ AV_PIX_FMT_FLAG_PLANAR,
-            /*.comp =*/ {
+            .nb_components = 3,
+            .log2_chroma_w = 1,
+            .log2_chroma_h = 0,
+            .comp = {
                 { 0, 1, 1, 0, 7 },        /* Y */
                 { 1, 1, 1, 0, 7 },        /* U */
                 { 2, 1, 1, 0, 7 },        /* V */
             },
+            .flags = AV_PIX_FMT_FLAG_PLANAR,
         }
     },
     {
         AV_PIX_FMT_YUV444P,
         {
             //.name = "yuv444p",
-			/*.name*/ 0,
-            /*.nb_components =*/ 3,
-            /*.log2_chroma_w =*/ 0,
-            /*.log2_chroma_h =*/ 0,
-			/*.flags*/ AV_PIX_FMT_FLAG_PLANAR,
-            /*.comp =*/ {
+            .nb_components = 3,
+            .log2_chroma_w = 0,
+            .log2_chroma_h = 0,
+            .comp = {
                 { 0, 1, 1, 0, 7 },        /* Y */
                 { 1, 1, 1, 0, 7 },        /* U */
                 { 2, 1, 1, 0, 7 },        /* V */
             },
+            .flags = AV_PIX_FMT_FLAG_PLANAR,
         }
     },
     {
         AV_PIX_FMT_GRAY8,
         {
             //.name = "gray",
-			/*.name*/ 0,
-            /*.nb_components =*/ 1,
-            /*.log2_chroma_w =*/ 0,
-            /*.log2_chroma_h =*/ 0,
-			/*.flags*/ 0,
-            /*.comp =*/ {
+            .nb_components = 1,
+            .log2_chroma_w = 0,
+            .log2_chroma_h = 0,
+            .comp = {
                 { 0, 1, 1, 0, 7 },       /* Y */
             },
         },
