]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/sp5xdec.c
avoid 2 additions (1 cpu cycle) per MB
[ffmpeg] / libavcodec / sp5xdec.c
index 9553943bbdd81d524fda9fb2e775ac83e77ed6c6..2234afa697c932369bd3395358a5502855db4b1b 100644 (file)
@@ -65,10 +65,8 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
     j += sizeof(sp5x_data_dht);
 
     memcpy(recoded+j, &sp5x_data_sof[0], sizeof(sp5x_data_sof));
-    recoded[j+5] = (avctx->coded_height >> 8) & 0xFF;
-    recoded[j+6] = avctx->coded_height & 0xFF;
-    recoded[j+7] = (avctx->coded_width >> 8) & 0xFF;
-    recoded[j+8] = avctx->coded_width & 0xFF;
+    AV_WB16(recoded+j+5, avctx->coded_height);
+    AV_WB16(recoded+j+7, avctx->coded_width);
     j += sizeof(sp5x_data_sof);
 
     memcpy(recoded+j, &sp5x_data_sos[0], sizeof(sp5x_data_sos));