comparison utils.c @ 5542:b0a566346fb1 libavcodec

Add attribute that forces alignment of stack to functions that need it. Necessary for systems that don't align by default to 16 bytes, required by some SSE instructions. Requires GCC >= 4.2. Based on patch by Ga¸«³l Chardon.
author ramiro
date Mon, 13 Aug 2007 15:28:29 +0000
parents 3d10c3e84f96
children b763947a7676
comparison
equal deleted inserted replaced
5541:6c385356e61f 5542:b0a566346fb1
827 avcodec_get_frame_defaults(pic); 827 avcodec_get_frame_defaults(pic);
828 828
829 return pic; 829 return pic;
830 } 830 }
831 831
832 int avcodec_open(AVCodecContext *avctx, AVCodec *codec) 832 int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
833 { 833 {
834 int ret= -1; 834 int ret= -1;
835 835
836 entangled_thread_counter++; 836 entangled_thread_counter++;
837 if(entangled_thread_counter != 1){ 837 if(entangled_thread_counter != 1){
878 end: 878 end:
879 entangled_thread_counter--; 879 entangled_thread_counter--;
880 return ret; 880 return ret;
881 } 881 }
882 882
883 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, 883 int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
884 const short *samples) 884 const short *samples)
885 { 885 {
886 if(buf_size < FF_MIN_BUFFER_SIZE && 0){ 886 if(buf_size < FF_MIN_BUFFER_SIZE && 0){
887 av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n"); 887 av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n");
888 return -1; 888 return -1;
893 return ret; 893 return ret;
894 }else 894 }else
895 return 0; 895 return 0;
896 } 896 }
897 897
898 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, 898 int attribute_align_arg avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
899 const AVFrame *pict) 899 const AVFrame *pict)
900 { 900 {
901 if(buf_size < FF_MIN_BUFFER_SIZE){ 901 if(buf_size < FF_MIN_BUFFER_SIZE){
902 av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n"); 902 av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n");
903 return -1; 903 return -1;
921 ret = avctx->codec->encode(avctx, buf, buf_size, (void *)sub); 921 ret = avctx->codec->encode(avctx, buf, buf_size, (void *)sub);
922 avctx->frame_number++; 922 avctx->frame_number++;
923 return ret; 923 return ret;
924 } 924 }
925 925
926 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, 926 int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
927 int *got_picture_ptr, 927 int *got_picture_ptr,
928 uint8_t *buf, int buf_size) 928 uint8_t *buf, int buf_size)
929 { 929 {
930 int ret; 930 int ret;
931 931
944 ret= 0; 944 ret= 0;
945 945
946 return ret; 946 return ret;
947 } 947 }
948 948
949 int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, 949 int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
950 int *frame_size_ptr, 950 int *frame_size_ptr,
951 uint8_t *buf, int buf_size) 951 uint8_t *buf, int buf_size)
952 { 952 {
953 int ret; 953 int ret;
954 954