Commit 5d4fd1d1 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master: (36 commits)
  ARM: allow unaligned buffer in fixed-point NEON FFT4
  fate: test more FFT etc sizes
  dca: set AVCodecContext frame_size for DTS audio
  YASM: Shut up unused variable compiler warning with --disable-yasm.
  x86_32: Fix build on x86_32 with --disable-yasm.
  iirfilter: add fate test
  doxygen: Add qmul docs.
  ogg: propagate return values and return more meaningful error values
  H.264: fix overreads of qscale_table
  Remove unused static tables and static inline functions.
  eval: clear Parser instances before using
  dct-test: remove 'ref' function pointer from tables
  build: Remove deleted 'check' target from .PHONY list.
  oggdec: Abort Ogg header parsing when encountering a data packet.
  Add LGPL license boilerplate to files lacking it.
  mxfenc: small typo fix
  doxygen: Fix documentation for some VP8 functions.
  sha: use AV_RB32() instead of assuming buffer can be cast to uint32_t*
  des: allow unaligned input and output buffers
  aes: allow unaligned input and output buffers
  ...

Conflicts:
	libavcodec/dct-test.c
	libavcodec/libvpxenc.c
	libavcodec/x86/dsputil_mmx.c
	libavcodec/x86/h264_qpel_mmx.c
	libavfilter/x86/gradfun.c
	libavformat/oggdec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 96676e1a 3824ef08
...@@ -164,5 +164,5 @@ $(sort $(OBJDIRS)): ...@@ -164,5 +164,5 @@ $(sort $(OBJDIRS)):
# so this saves some time on slow systems. # so this saves some time on slow systems.
.SUFFIXES: .SUFFIXES:
.PHONY: all all-yes alltools *clean check config examples install* .PHONY: all all-yes alltools *clean config examples install*
.PHONY: testprogs uninstall* .PHONY: testprogs uninstall*
...@@ -75,9 +75,9 @@ ...@@ -75,9 +75,9 @@
.endm .endm
function fft4_neon function fft4_neon
vld1.16 {d0-d1}, [r0,:128] vld1.16 {d0-d1}, [r0]
fft4 d0, d1, d2, d3 fft4 d0, d1, d2, d3
vst1.16 {d0-d1}, [r0,:128] vst1.16 {d0-d1}, [r0]
bx lr bx lr
endfunc endfunc
......
...@@ -1650,6 +1650,7 @@ static int dca_decode_frame(AVCodecContext * avctx, ...@@ -1650,6 +1650,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
//set AVCodec values with parsed data //set AVCodec values with parsed data
avctx->sample_rate = s->sample_rate; avctx->sample_rate = s->sample_rate;
avctx->bit_rate = s->bit_rate; avctx->bit_rate = s->bit_rate;
avctx->frame_size = s->sample_blocks * 32;
s->profile = FF_PROFILE_DTS; s->profile = FF_PROFILE_DTS;
......
This diff is collapsed.
...@@ -237,6 +237,7 @@ void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM * ...@@ -237,6 +237,7 @@ void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM *
} }
/** /**
* IDCT transforms the 16 dc values and dequantizes them. * IDCT transforms the 16 dc values and dequantizes them.
* @param qmul quantization parameter
*/ */
void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, int qmul){ void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, int qmul){
#define stride 16 #define stride 16
......
/*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dsputil.h" #include "dsputil.h"
#ifndef BIT_DEPTH #ifndef BIT_DEPTH
......
...@@ -311,6 +311,9 @@ av_cold void ff_iir_filter_free_coeffs(struct FFIIRFilterCoeffs *coeffs) ...@@ -311,6 +311,9 @@ av_cold void ff_iir_filter_free_coeffs(struct FFIIRFilterCoeffs *coeffs)
} }
#ifdef TEST #ifdef TEST
#undef printf
#include <stdio.h>
#define FILT_ORDER 4 #define FILT_ORDER 4
#define SIZE 1024 #define SIZE 1024
int main(void) int main(void)
...@@ -320,7 +323,6 @@ int main(void) ...@@ -320,7 +323,6 @@ int main(void)
float cutoff_coeff = 0.4; float cutoff_coeff = 0.4;
int16_t x[SIZE], y[SIZE]; int16_t x[SIZE], y[SIZE];
int i; int i;
FILE* fd;
fcoeffs = ff_iir_filter_init_coeffs(NULL, FF_FILTER_TYPE_BUTTERWORTH, fcoeffs = ff_iir_filter_init_coeffs(NULL, FF_FILTER_TYPE_BUTTERWORTH,
FF_FILTER_MODE_LOWPASS, FILT_ORDER, FF_FILTER_MODE_LOWPASS, FILT_ORDER,
...@@ -333,13 +335,8 @@ int main(void) ...@@ -333,13 +335,8 @@ int main(void)
ff_iir_filter(fcoeffs, fstate, SIZE, x, 1, y, 1); ff_iir_filter(fcoeffs, fstate, SIZE, x, 1, y, 1);
fd = fopen("in.bin", "w"); for (i = 0; i < SIZE; i++)
fwrite(x, sizeof(x[0]), SIZE, fd); printf("%6d %6d\n", x[i], y[i]);
fclose(fd);
fd = fopen("out.bin", "w");
fwrite(y, sizeof(y[0]), SIZE, fd);
fclose(fd);
ff_iir_filter_free_coeffs(fcoeffs); ff_iir_filter_free_coeffs(fcoeffs);
ff_iir_filter_free_state(fstate); ff_iir_filter_free_state(fstate);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "bytestream.h" #include "bytestream.h"
#include "vorbis.h" #include "vorbis.h"
#include "libavutil/mathematics.h"
#undef NDEBUG #undef NDEBUG
#include <assert.h> #include <assert.h>
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "libavutil/base64.h" #include "libavutil/base64.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/mathematics.h"
/** /**
* Portion of struct vpx_codec_cx_pkt from vpx_encoder.h. * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h.
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libxvid_internal.h" #include "libxvid_internal.h"
#if !HAVE_MKSTEMP #if !HAVE_MKSTEMP
#include <fcntl.h> #include <fcntl.h>
......
...@@ -285,9 +285,10 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){ ...@@ -285,9 +285,10 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){
} }
FF_ALLOCZ_OR_GOTO(s->avctx, pic->mbskip_table , mb_array_size * sizeof(uint8_t)+2, fail) //the +2 is for the slice end check FF_ALLOCZ_OR_GOTO(s->avctx, pic->mbskip_table , mb_array_size * sizeof(uint8_t)+2, fail) //the +2 is for the slice end check
FF_ALLOCZ_OR_GOTO(s->avctx, pic->qscale_table , mb_array_size * sizeof(uint8_t) , fail) FF_ALLOCZ_OR_GOTO(s->avctx, pic->qscale_table_base , (big_mb_num + s->mb_stride) * sizeof(uint8_t) , fail)
FF_ALLOCZ_OR_GOTO(s->avctx, pic->mb_type_base , (big_mb_num + s->mb_stride) * sizeof(uint32_t), fail) FF_ALLOCZ_OR_GOTO(s->avctx, pic->mb_type_base , (big_mb_num + s->mb_stride) * sizeof(uint32_t), fail)
pic->mb_type= pic->mb_type_base + 2*s->mb_stride+1; pic->mb_type= pic->mb_type_base + 2*s->mb_stride+1;
pic->qscale_table = pic->qscale_table_base + 2*s->mb_stride + 1;
if(s->out_format == FMT_H264){ if(s->out_format == FMT_H264){
for(i=0; i<2; i++){ for(i=0; i<2; i++){
FF_ALLOCZ_OR_GOTO(s->avctx, pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t), fail) FF_ALLOCZ_OR_GOTO(s->avctx, pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t), fail)
...@@ -339,7 +340,7 @@ static void free_picture(MpegEncContext *s, Picture *pic){ ...@@ -339,7 +340,7 @@ static void free_picture(MpegEncContext *s, Picture *pic){
av_freep(&pic->mc_mb_var); av_freep(&pic->mc_mb_var);
av_freep(&pic->mb_mean); av_freep(&pic->mb_mean);
av_freep(&pic->mbskip_table); av_freep(&pic->mbskip_table);
av_freep(&pic->qscale_table); av_freep(&pic->qscale_table_base);
av_freep(&pic->mb_type_base); av_freep(&pic->mb_type_base);
av_freep(&pic->dct_coeff); av_freep(&pic->dct_coeff);
av_freep(&pic->pan_scan); av_freep(&pic->pan_scan);
......
...@@ -88,6 +88,7 @@ typedef struct Picture{ ...@@ -88,6 +88,7 @@ typedef struct Picture{
* halfpel luma planes. * halfpel luma planes.
*/ */
uint8_t *interpolated[3]; uint8_t *interpolated[3];
int8_t *qscale_table_base;
int16_t (*motion_val_base[2])[2]; int16_t (*motion_val_base[2])[2];
uint32_t *mb_type_base; uint32_t *mb_type_base;
#define MB_TYPE_INTRA MB_TYPE_INTRA4x4 //default mb_type if there is just one type #define MB_TYPE_INTRA MB_TYPE_INTRA4x4 //default mb_type if there is just one type
......
/*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** /**
* @file * @file
* This header is provided for compatibility only and will be removed * This header is provided for compatibility only and will be removed
......
...@@ -423,17 +423,6 @@ static inline RV34VLC* choose_vlc_set(int quant, int mod, int type) ...@@ -423,17 +423,6 @@ static inline RV34VLC* choose_vlc_set(int quant, int mod, int type)
: &intra_vlcs[rv34_quant_to_vlc_set[0][av_clip(quant, 0, 30)]]; : &intra_vlcs[rv34_quant_to_vlc_set[0][av_clip(quant, 0, 30)]];
} }
/**
* Decode quantizer difference and return modified quantizer.
*/
static inline int rv34_decode_dquant(GetBitContext *gb, int quant)
{
if(get_bits1(gb))
return rv34_dquant_tab[get_bits1(gb)][quant];
else
return get_bits(gb, 5);
}
/** /**
* Decode macroblock header and return CBP in case of success, -1 otherwise. * Decode macroblock header and return CBP in case of success, -1 otherwise.
*/ */
...@@ -1255,15 +1244,6 @@ static int check_slice_end(RV34DecContext *r, MpegEncContext *s) ...@@ -1255,15 +1244,6 @@ static int check_slice_end(RV34DecContext *r, MpegEncContext *s)
return 0; return 0;
} }
static inline int slice_compare(SliceInfo *si1, SliceInfo *si2)
{
return si1->type != si2->type ||
si1->start >= si2->start ||
si1->width != si2->width ||
si1->height != si2->height||
si1->pts != si2->pts;
}
static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int buf_size) static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int buf_size)
{ {
MpegEncContext *s = &r->s; MpegEncContext *s = &r->s;
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#define MB_INTRA_VLC_BITS 9 #define MB_INTRA_VLC_BITS 9
#define DC_VLC_BITS 9 #define DC_VLC_BITS 9
#define AC_VLC_BITS 9 #define AC_VLC_BITS 9
static const uint16_t table_mb_intra[64][2];
static const uint16_t vlc_offs[] = { static const uint16_t vlc_offs[] = {
......
...@@ -641,8 +641,6 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_ ...@@ -641,8 +641,6 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_
* @param block destination for block coefficients * @param block destination for block coefficients
* @param probs probabilities to use when reading trees from the bitstream * @param probs probabilities to use when reading trees from the bitstream
* @param i initial coeff index, 0 unless a separate DC block is coded * @param i initial coeff index, 0 unless a separate DC block is coded
* @param zero_nhood the initial prediction context for number of surrounding
* all-zero blocks (only left/top, so 0-2)
* @param qmul array holding the dc/ac dequant factor at position 0/1 * @param qmul array holding the dc/ac dequant factor at position 0/1
* @return 0 if no coeffs were decoded * @return 0 if no coeffs were decoded
* otherwise, the index of the last coeff decoded plus one * otherwise, the index of the last coeff decoded plus one
...@@ -701,6 +699,17 @@ skip_eob: ...@@ -701,6 +699,17 @@ skip_eob:
} }
#endif #endif
/**
* @param c arithmetic bitstream reader context
* @param block destination for block coefficients
* @param probs probabilities to use when reading trees from the bitstream
* @param i initial coeff index, 0 unless a separate DC block is coded
* @param zero_nhood the initial prediction context for number of surrounding
* all-zero blocks (only left/top, so 0-2)
* @param qmul array holding the dc/ac dequant factor at position 0/1
* @return 0 if no coeffs were decoded
* otherwise, the index of the last coeff decoded plus one
*/
static av_always_inline static av_always_inline
int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16], int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16],
uint8_t probs[16][3][NUM_DCT_TOKENS-1], uint8_t probs[16][3][NUM_DCT_TOKENS-1],
...@@ -1034,10 +1043,9 @@ static const uint8_t subpel_idx[3][8] = { ...@@ -1034,10 +1043,9 @@ static const uint8_t subpel_idx[3][8] = {
}; };
/** /**
* Generic MC function. * luma MC function
* *
* @param s VP8 decoding context * @param s VP8 decoding context
* @param luma 1 for luma (Y) planes, 0 for chroma (Cb/Cr) planes
* @param dst target buffer for block data at block position * @param dst target buffer for block data at block position
* @param ref reference picture buffer at origin (0, 0) * @param ref reference picture buffer at origin (0, 0)
* @param mv motion vector (relative to block position) to get pixel data from * @param mv motion vector (relative to block position) to get pixel data from
...@@ -1083,6 +1091,23 @@ void vp8_mc_luma(VP8Context *s, uint8_t *dst, AVFrame *ref, const VP56mv *mv, ...@@ -1083,6 +1091,23 @@ void vp8_mc_luma(VP8Context *s, uint8_t *dst, AVFrame *ref, const VP56mv *mv,
} }
} }
/**
* chroma MC function
*
* @param s VP8 decoding context
* @param dst1 target buffer for block data at block position (U plane)
* @param dst2 target buffer for block data at block position (V plane)
* @param ref reference picture buffer at origin (0, 0)
* @param mv motion vector (relative to block position) to get pixel data from
* @param x_off horizontal position of block from origin (0, 0)
* @param y_off vertical position of block from origin (0, 0)
* @param block_w width of block (16, 8 or 4)
* @param block_h height of block (always same as block_w)
* @param width width of src/dst plane data
* @param height height of src/dst plane data
* @param linesize size of a single line of plane data, including padding
* @param mc_func motion compensation function pointers (bilinear or sixtap MC)
*/
static av_always_inline static av_always_inline
void vp8_mc_chroma(VP8Context *s, uint8_t *dst1, uint8_t *dst2, AVFrame *ref, void vp8_mc_chroma(VP8Context *s, uint8_t *dst1, uint8_t *dst2, AVFrame *ref,
const VP56mv *mv, int x_off, int y_off, const VP56mv *mv, int x_off, int y_off,
......
...@@ -2563,8 +2563,8 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -2563,8 +2563,8 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmx2, ); SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmx2, );
SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmx2, ); SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmx2, );
} }
#if HAVE_YASM
else if (bit_depth == 10) { else if (bit_depth == 10) {
#if HAVE_YASM
#if !ARCH_X86_64 #if !ARCH_X86_64
SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 10_mmxext, ff_); SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 10_mmxext, ff_);
SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 10_mmxext, ff_); SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 10_mmxext, ff_);
...@@ -2573,8 +2573,8 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -2573,8 +2573,8 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
#endif #endif
SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 10_mmxext, ff_); SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 10_mmxext, ff_);
SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 10_mmxext, ff_); SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 10_mmxext, ff_);
}
#endif #endif
}
SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmx2, ); SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmx2, );
SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmx2, ); SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmx2, );
......
...@@ -1294,6 +1294,6 @@ QPEL16_OP(mc31, MMX)\ ...@@ -1294,6 +1294,6 @@ QPEL16_OP(mc31, MMX)\
QPEL16_OP(mc32, MMX)\ QPEL16_OP(mc32, MMX)\
QPEL16_OP(mc33, MMX) QPEL16_OP(mc33, MMX)
#if HAVE_YASM && ARCH_X86_32 // ARCH_X86_64 implies sse2+ #if ARCH_X86_32 && HAVE_YASM // ARCH_X86_64 implies sse2+
QPEL16(mmxext) QPEL16(mmxext)
#endif #endif
/* /*
* Copyright (C) 2009 Loren Merritt <lorenm@u.washignton.edu>
*
* This file is part of FFmpeg. * This file is part of FFmpeg.
* *
* FFmpeg is free software; you can redistribute it and/or modify * FFmpeg is free software; you can redistribute it and/or
* it under the terms of the GNU General Public License as published by * modify it under the terms of the GNU Lesser General Public
* the Free Software Foundation; either version 2 of the License, or * License as published by the Free Software Foundation; either
* (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* FFmpeg is distributed in the hope that it will be useful, * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* GNU General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU Lesser General Public
* with FFmpeg; if not, write to the Free Software Foundation, Inc., * License along with FFmpeg; if not, write to the Free Software
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
......
...@@ -1549,7 +1549,7 @@ static uint32_t ff_framenum_to_12m_time_code(unsigned frame, int drop, int fps) ...@@ -1549,7 +1549,7 @@ static uint32_t ff_framenum_to_12m_time_code(unsigned frame, int drop, int fps)
((((frame / (fps * 60)) % 60) / 10) << 12) | // tens of minutes ((((frame / (fps * 60)) % 60) / 10) << 12) | // tens of minutes
((((frame / (fps * 60)) % 60) % 10) << 8) | // units of minutes ((((frame / (fps * 60)) % 60) % 10) << 8) | // units of minutes
(0 << 7) | // b1 (0 << 7) | // b1
(0 << 6) | // b2 (NSC), field phase (PAL) (0 << 6) | // b2 (NTSC), field phase (PAL)
((((frame / (fps * 3600) % 24)) / 10) << 4) | // tens of hours ((((frame / (fps * 3600) % 24)) / 10) << 4) | // tens of hours
( (frame / (fps * 3600) % 24)) % 10; // units of hours ( (frame / (fps * 3600) % 24)) % 10; // units of hours
} }
......
...@@ -201,7 +201,7 @@ static int ogg_read_page(AVFormatContext *s, int *str) ...@@ -201,7 +201,7 @@ static int ogg_read_page(AVFormatContext *s, int *str)
uint8_t sync[4]; uint8_t sync[4];
int sp = 0; int sp = 0;
ret = avio_read (bc, sync, 4); ret = avio_read(bc, sync, 4);
if (ret < 4) if (ret < 4)
return ret < 0 ? ret : AVERROR_EOF; return ret < 0 ? ret : AVERROR_EOF;
...@@ -259,7 +259,7 @@ static int ogg_read_page(AVFormatContext *s, int *str) ...@@ -259,7 +259,7 @@ static int ogg_read_page(AVFormatContext *s, int *str)
if(os->psize > 0) if(os->psize > 0)
ogg_new_buf(ogg, idx); ogg_new_buf(ogg, idx);
ret = avio_read (bc, os->segments, nsegs); ret = avio_read(bc, os->segments, nsegs);
if (ret < nsegs) if (ret < nsegs)
return ret < 0 ? ret : AVERROR_EOF; return ret < 0 ? ret : AVERROR_EOF;
...@@ -292,7 +292,7 @@ static int ogg_read_page(AVFormatContext *s, int *str) ...@@ -292,7 +292,7 @@ static int ogg_read_page(AVFormatContext *s, int *str)
os->buf = nb; os->buf = nb;
} }
ret = avio_read (bc, os->buf + os->bufpos, size); ret = avio_read(bc, os->buf + os->bufpos, size);
if (ret < size) if (ret < size)
return ret < 0 ? ret : AVERROR_EOF; return ret < 0 ? ret : AVERROR_EOF;
...@@ -321,7 +321,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize, ...@@ -321,7 +321,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
idx = ogg->curidx; idx = ogg->curidx;
while (idx < 0){ while (idx < 0){
ret = ogg_read_page (s, &idx); ret = ogg_read_page(s, &idx);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
...@@ -437,7 +437,7 @@ static int ogg_get_headers(AVFormatContext *s) ...@@ -437,7 +437,7 @@ static int ogg_get_headers(AVFormatContext *s)
int ret; int ret;
do{ do{
ret = ogg_packet (s, NULL, NULL, NULL, NULL); ret = ogg_packet(s, NULL, NULL, NULL, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;
}while (!ogg->headers); }while (!ogg->headers);
...@@ -501,10 +501,9 @@ static int ogg_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -501,10 +501,9 @@ static int ogg_read_header(AVFormatContext *s, AVFormatParameters *ap)
int ret, i; int ret, i;
ogg->curidx = -1; ogg->curidx = -1;
//linear headers seek from start //linear headers seek from start
ret = ogg_get_headers (s); ret = ogg_get_headers(s);
if (ret < 0){ if (ret < 0)
return ret; return ret;
}
for (i = 0; i < ogg->nstreams; i++) for (i = 0; i < ogg->nstreams; i++)
if (ogg->streams[i].header < 0) if (ogg->streams[i].header < 0)
...@@ -558,7 +557,7 @@ static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -558,7 +557,7 @@ static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt)
//Get an ogg packet //Get an ogg packet
retry: retry:
do{ do{
ret = ogg_packet (s, &idx, &pstart, &psize, &fpos); ret = ogg_packet(s, &idx, &pstart, &psize, &fpos);
if (ret < 0) if (ret < 0)
return ret; return ret;
}while (idx < 0 || !s->streams[idx]); }while (idx < 0 || !s->streams[idx]);
...@@ -574,7 +573,7 @@ retry: ...@@ -574,7 +573,7 @@ retry:
os->keyframe_seek = 0; os->keyframe_seek = 0;
//Alloc a pkt //Alloc a pkt
ret = av_new_packet (pkt, psize); ret = av_new_packet(pkt, psize);
if (ret < 0) if (ret < 0)
return ret; return ret;
pkt->stream_index = idx; pkt->stream_index = idx;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "common.h" #include "common.h"
#include "aes.h" #include "aes.h"
#include "intreadwrite.h"
typedef union { typedef union {
uint64_t u64[2]; uint64_t u64[2];
...@@ -67,6 +68,20 @@ static inline void addkey(av_aes_block *dst, const av_aes_block *src, ...@@ -67,6 +68,20 @@ static inline void addkey(av_aes_block *dst, const av_aes_block *src,
dst->u64[1] = src->u64[1] ^ round_key->u64[1]; dst->u64[1] = src->u64[1] ^ round_key->u64[1];
} }
static inline void addkey_s(av_aes_block *dst, const uint8_t *src,
const av_aes_block *round_key)
{
dst->u64[0] = AV_RN64(src) ^ round_key->u64[0];
dst->u64[1] = AV_RN64(src + 8) ^ round_key->u64[1];
}
static inline void addkey_d(uint8_t *dst, const av_aes_block *src,
const av_aes_block *round_key)
{
AV_WN64(dst, src->u64[0] ^ round_key->u64[0]);
AV_WN64(dst + 8, src->u64[1] ^ round_key->u64[1]);
}
static void subshift(av_aes_block s0[2], int s, const uint8_t *box) static void subshift(av_aes_block s0[2], int s, const uint8_t *box)
{ {
av_aes_block *s1 = (av_aes_block *) (s0[0].u8 - s); av_aes_block *s1 = (av_aes_block *) (s0[0].u8 - s);
...@@ -119,32 +134,28 @@ static inline void crypt(AVAES *a, int s, const uint8_t *sbox, ...@@ -119,32 +134,28 @@ static inline void crypt(AVAES *a, int s, const uint8_t *sbox,
subshift(&a->state[0], s, sbox); subshift(&a->state[0], s, sbox);
} }
void av_aes_crypt(AVAES *a, uint8_t *dst_, const uint8_t *src_, void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src,
int count, uint8_t *iv_, int decrypt) int count, uint8_t *iv, int decrypt)
{ {
av_aes_block *dst = (av_aes_block *) dst_;
const av_aes_block *src = (const av_aes_block *) src_;
av_aes_block *iv = (av_aes_block *) iv_;
while (count--) { while (count--) {
addkey(&a->state[1], src, &a->round_key[a->rounds]); addkey_s(&a->state[1], src, &a->round_key[a->rounds]);
if (decrypt) { if (decrypt) {
crypt(a, 0, inv_sbox, dec_multbl); crypt(a, 0, inv_sbox, dec_multbl);
if (iv) { if (iv) {
addkey(&a->state[0], &a->state[0], iv); addkey_s(&a->state[0], iv, &a->state[0]);
*iv = *src; memcpy(iv, src, 16);
} }
addkey(dst, &a->state[0], &a->round_key[0]); addkey_d(dst, &a->state[0], &a->round_key[0]);
} else { } else {
if (iv) if (iv)
addkey(&a->state[1], &a->state[1], iv); addkey_s(&a->state[1], iv, &a->state[1]);
crypt(a, 2, sbox, enc_multbl); crypt(a, 2, sbox, enc_multbl);
addkey(dst, &a->state[0], &a->round_key[0]); addkey_d(dst, &a->state[0], &a->round_key[0]);
if (iv) if (iv)
*iv = *dst; memcpy(iv, dst, 16);
} }
src++; src += 16;
dst++; dst += 16;
} }
} }
......
...@@ -299,10 +299,10 @@ int av_des_init(AVDES *d, const uint8_t *key, int key_bits, int decrypt) { ...@@ -299,10 +299,10 @@ int av_des_init(AVDES *d, const uint8_t *key, int key_bits, int decrypt) {
} }
void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt) { void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt) {
uint64_t iv_val = iv ? av_be2ne64(*(uint64_t *)iv) : 0; uint64_t iv_val = iv ? AV_RB64(iv) : 0;
while (count-- > 0) { while (count-- > 0) {
uint64_t dst_val; uint64_t dst_val;
uint64_t src_val = src ? av_be2ne64(*(const uint64_t *)src) : 0; uint64_t src_val = src ? AV_RB64(src) : 0;
if (decrypt) { if (decrypt) {
uint64_t tmp = src_val; uint64_t tmp = src_val;
if (d->triple_des) { if (d->triple_des) {
...@@ -319,12 +319,12 @@ void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t ...@@ -319,12 +319,12 @@ void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t
} }
iv_val = iv ? dst_val : 0; iv_val = iv ? dst_val : 0;
} }
*(uint64_t *)dst = av_be2ne64(dst_val); AV_WB64(dst, dst_val);
src += 8; src += 8;
dst += 8; dst += 8;
} }
if (iv) if (iv)
*(uint64_t *)iv = av_be2ne64(iv_val); AV_WB64(iv, iv_val);
} }
#ifdef TEST #ifdef TEST
......
...@@ -472,7 +472,7 @@ int av_expr_parse(AVExpr **expr, const char *s, ...@@ -472,7 +472,7 @@ int av_expr_parse(AVExpr **expr, const char *s,
const char * const *func2_names, double (* const *funcs2)(void *, double, double), const char * const *func2_names, double (* const *funcs2)(void *, double, double),
int log_offset, void *log_ctx) int log_offset, void *log_ctx)
{ {
Parser p; Parser p = { 0 };
AVExpr *e = NULL; AVExpr *e = NULL;
char *w = av_malloc(strlen(s) + 1); char *w = av_malloc(strlen(s) + 1);
char *wp = w; char *wp = w;
...@@ -517,7 +517,7 @@ end: ...@@ -517,7 +517,7 @@ end:
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque) double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
{ {
Parser p; Parser p = { 0 };
p.const_values = const_values; p.const_values = const_values;
p.opaque = opaque; p.opaque = opaque;
...@@ -576,6 +576,8 @@ void av_free_expr(AVExpr *e) ...@@ -576,6 +576,8 @@ void av_free_expr(AVExpr *e)
#ifdef TEST #ifdef TEST
#undef printf #undef printf
#include <string.h>
static double const_values[] = { static double const_values[] = {
M_PI, M_PI,
M_E, M_E,
...@@ -588,7 +590,7 @@ static const char *const_names[] = { ...@@ -588,7 +590,7 @@ static const char *const_names[] = {
0 0
}; };
int main(void) int main(int argc, char **argv)
{ {
int i; int i;
double d; double d;
...@@ -669,13 +671,16 @@ int main(void) ...@@ -669,13 +671,16 @@ int main(void)
NULL, NULL, NULL, NULL, NULL, 0, NULL); NULL, NULL, NULL, NULL, NULL, 0, NULL);
printf("%f == 0.931322575\n", d); printf("%f == 0.931322575\n", d);
for (i=0; i<1050; i++) { if (argc > 1 && !strcmp(argv[1], "-t")) {
START_TIMER for (i = 0; i < 1050; i++) {
START_TIMER;
av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
const_names, const_values, const_names, const_values,
NULL, NULL, NULL, NULL, NULL, 0, NULL); NULL, NULL, NULL, NULL, NULL, 0, NULL);
STOP_TIMER("av_expr_parse_and_eval") STOP_TIMER("av_expr_parse_and_eval");
}
} }
return 0; return 0;
} }
#endif #endif
...@@ -42,7 +42,7 @@ const int av_sha_size = sizeof(AVSHA); ...@@ -42,7 +42,7 @@ const int av_sha_size = sizeof(AVSHA);
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
#define blk0(i) (block[i] = av_be2ne32(((const uint32_t*)buffer)[i])) #define blk0(i) (block[i] = AV_RB32(buffer + 4 * (i)))
#define blk(i) (block[i] = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1)) #define blk(i) (block[i] = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1))
#define R0(v,w,x,y,z,i) z += ((w&(x^y))^y) + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); #define R0(v,w,x,y,z,i) z += ((w&(x^y))^y) + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30);
...@@ -67,7 +67,7 @@ static void sha1_transform(uint32_t state[5], const uint8_t buffer[64]) ...@@ -67,7 +67,7 @@ static void sha1_transform(uint32_t state[5], const uint8_t buffer[64])
for (i = 0; i < 80; i++) { for (i = 0; i < 80; i++) {
int t; int t;
if (i < 16) if (i < 16)
t = av_be2ne32(((uint32_t*)buffer)[i]); t = AV_RB32(buffer + 4 * i);
else else
t = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1); t = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1);
block[i] = t; block[i] = t;
......
...@@ -80,17 +80,6 @@ untested special converters ...@@ -80,17 +80,6 @@ untested special converters
#define RV ( (int)(0.500*224/255*(1<<RGB2YUV_SHIFT)+0.5)) #define RV ( (int)(0.500*224/255*(1<<RGB2YUV_SHIFT)+0.5))
#define RU (-(int)(0.169*224/255*(1<<RGB2YUV_SHIFT)+0.5)) #define RU (-(int)(0.169*224/255*(1<<RGB2YUV_SHIFT)+0.5))
static const double rgb2yuv_table[8][9]={
{0.7152, 0.0722, 0.2126, -0.386, 0.5, -0.115, -0.454, -0.046, 0.5}, //ITU709
{0.7152, 0.0722, 0.2126, -0.386, 0.5, -0.115, -0.454, -0.046, 0.5}, //ITU709
{0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5}, //DEFAULT / ITU601 / ITU624 / SMPTE 170M
{0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5}, //DEFAULT / ITU601 / ITU624 / SMPTE 170M
{0.59 , 0.11 , 0.30 , -0.331, 0.5, -0.169, -0.421, -0.079, 0.5}, //FCC
{0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5}, //DEFAULT / ITU601 / ITU624 / SMPTE 170M
{0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5}, //DEFAULT / ITU601 / ITU624 / SMPTE 170M
{0.701 , 0.087 , 0.212 , -0.384, 0.5, -0.116, -0.445, -0.055, 0.5}, //SMPTE 240M
};
/* /*
NOTES NOTES
Special versions: fast Y 1:1 scaling (no interpolation in y direction) Special versions: fast Y 1:1 scaling (no interpolation in y direction)
......
...@@ -41,6 +41,7 @@ include $(SRC_PATH)/tests/fate/aac.mak ...@@ -41,6 +41,7 @@ include $(SRC_PATH)/tests/fate/aac.mak
include $(SRC_PATH)/tests/fate/als.mak include $(SRC_PATH)/tests/fate/als.mak
include $(SRC_PATH)/tests/fate/amrnb.mak include $(SRC_PATH)/tests/fate/amrnb.mak
include $(SRC_PATH)/tests/fate/amrwb.mak include $(SRC_PATH)/tests/fate/amrwb.mak
include $(SRC_PATH)/tests/fate/dct.mak
include $(SRC_PATH)/tests/fate/fft.mak include $(SRC_PATH)/tests/fate/fft.mak
include $(SRC_PATH)/tests/fate/h264.mak include $(SRC_PATH)/tests/fate/h264.mak
include $(SRC_PATH)/tests/fate/libavutil.mak include $(SRC_PATH)/tests/fate/libavutil.mak
......
...@@ -123,6 +123,7 @@ if test -e "$ref"; then ...@@ -123,6 +123,7 @@ if test -e "$ref"; then
diff) diff -u -w "$ref" "$outfile" >$cmpfile ;; diff) diff -u -w "$ref" "$outfile" >$cmpfile ;;
oneoff) oneoff "$ref" "$outfile" "$fuzz" >$cmpfile ;; oneoff) oneoff "$ref" "$outfile" "$fuzz" >$cmpfile ;;
stddev) stddev "$ref" "$outfile" "$fuzz" >$cmpfile ;; stddev) stddev "$ref" "$outfile" "$fuzz" >$cmpfile ;;
null) cat "$outfile" >$cmpfile ;;
esac esac
cmperr=$? cmperr=$?
test $err = 0 && err=$cmperr test $err = 0 && err=$cmperr
......
FATE_TESTS += fate-idct8x8
fate-idct8x8: libavcodec/dct-test$(EXESUF)
fate-idct8x8: CMD = run libavcodec/dct-test -i
fate-idct8x8: REF = /dev/null
fate-idct8x8: CMP = null
FATE_FFT = fate-fft fate-ifft \ define DEF_FFT
fate-mdct fate-imdct \ FATE_FFT += fate-fft-$(1) fate-ifft-$(1) \
fate-rdft fate-irdft \ fate-mdct-$(1) fate-imdct-$(1) \
fate-dct1d fate-idct1d fate-rdft-$(1) fate-irdft-$(1) \
fate-dct1d-$(1) fate-idct1d-$(1)
fate-fft: CMD = run libavcodec/fft-test
fate-ifft: CMD = run libavcodec/fft-test -i fate-fft-$(N): CMD = run libavcodec/fft-test -n$(1)
fate-mdct: CMD = run libavcodec/fft-test -m fate-ifft-$(N): CMD = run libavcodec/fft-test -n$(1) -i
fate-imdct: CMD = run libavcodec/fft-test -m -i fate-mdct-$(N): CMD = run libavcodec/fft-test -n$(1) -m
fate-rdft: CMD = run libavcodec/fft-test -r fate-imdct-$(N): CMD = run libavcodec/fft-test -n$(1) -m -i
fate-irdft: CMD = run libavcodec/fft-test -r -i fate-rdft-$(N): CMD = run libavcodec/fft-test -n$(1) -r
fate-dct1d: CMD = run libavcodec/fft-test -d fate-irdft-$(N): CMD = run libavcodec/fft-test -n$(1) -r -i
fate-idct1d: CMD = run libavcodec/fft-test -d -i fate-dct1d-$(N): CMD = run libavcodec/fft-test -n$(1) -d
fate-idct1d-$(N): CMD = run libavcodec/fft-test -n$(1) -d -i
endef
$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT,$(N))))
fate-fft-test: $(FATE_FFT) fate-fft-test: $(FATE_FFT)
$(FATE_FFT): libavcodec/fft-test$(EXESUF) $(FATE_FFT): libavcodec/fft-test$(EXESUF)
$(FATE_FFT): REF = /dev/null $(FATE_FFT): REF = /dev/null
FATE_FFT_FIXED = fate-fft-fixed fate-ifft-fixed \ define DEF_FFT_FIXED
fate-mdct-fixed fate-imdct-fixed FATE_FFT_FIXED += fate-fft-fixed-$(1) fate-ifft-fixed-$(1) \
fate-mdct-fixed-$(1) fate-imdct-fixed-$(1)
fate-fft-fixed-$(1): CMD = run libavcodec/fft-fixed-test -n$(1)
fate-ifft-fixed-$(1): CMD = run libavcodec/fft-fixed-test -n$(1) -i
fate-mdct-fixed-$(1): CMD = run libavcodec/fft-fixed-test -n$(1) -m
fate-imdct-fixed-$(1): CMD = run libavcodec/fft-fixed-test -n$(1) -m -i
endef
fate-fft-fixed: CMD = run libavcodec/fft-fixed-test $(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT_FIXED,$(N))))
fate-ifft-fixed: CMD = run libavcodec/fft-fixed-test -i
fate-mdct-fixed: CMD = run libavcodec/fft-fixed-test -m
fate-imdct-fixed: CMD = run libavcodec/fft-fixed-test -m -i
fate-fft-fixed-test: $(FATE_FFT_FIXED) fate-fft-fixed-test: $(FATE_FFT_FIXED)
$(FATE_FFT_FIXED): libavcodec/fft-fixed-test$(EXESUF) $(FATE_FFT_FIXED): libavcodec/fft-fixed-test$(EXESUF)
......
...@@ -21,6 +21,10 @@ fate-des: libavutil/des-test$(EXESUF) ...@@ -21,6 +21,10 @@ fate-des: libavutil/des-test$(EXESUF)
fate-des: CMD = run libavutil/des-test fate-des: CMD = run libavutil/des-test
fate-des: REF = /dev/null fate-des: REF = /dev/null
FATE_TESTS += fate-eval
fate-eval: libavutil/eval-test$(EXESUF)
fate-eval: CMD = run libavutil/eval-test
FATE_TESTS += fate-md5 FATE_TESTS += fate-md5
fate-md5: libavutil/md5-test$(EXESUF) fate-md5: libavutil/md5-test$(EXESUF)
fate-md5: CMD = run libavutil/md5-test fate-md5: CMD = run libavutil/md5-test
......
...@@ -218,3 +218,7 @@ fate-musepack7: CMD = pcm -i $(SAMPLES)/musepack/inside-mp7.mpc ...@@ -218,3 +218,7 @@ fate-musepack7: CMD = pcm -i $(SAMPLES)/musepack/inside-mp7.mpc
fate-musepack7: CMP = oneoff fate-musepack7: CMP = oneoff
fate-musepack7: REF = $(SAMPLES)/musepack/inside-mp7.pcm fate-musepack7: REF = $(SAMPLES)/musepack/inside-mp7.pcm
fate-musepack7: FUZZ = 1 fate-musepack7: FUZZ = 1
FATE_TESTS += fate-iirfilter
fate-iirfilter: libavcodec/iirfilter-test$(EXESUF)
fate-iirfilter: CMD = run libavcodec/iirfilter-test
Evaluating ''
'' -> nan
Evaluating '1;2'
'1;2' -> 2.000000
Evaluating '-20'
'-20' -> -20.000000
Evaluating '-PI'
'-PI' -> -3.141593
Evaluating '+PI'
'+PI' -> 3.141593
Evaluating '1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)'
'1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)' -> 12.700000
Evaluating '80G/80Gi1k'
'80G/80Gi1k' -> nan
Evaluating '1Gi'
'1Gi' -> 1073741824.000000
Evaluating '1gi'
'1gi' -> nan
Evaluating '1GiFoo'
'1GiFoo' -> nan
Evaluating '1k+1k'
'1k+1k' -> 2000.000000
Evaluating '1Gi*3foo'
'1Gi*3foo' -> nan
Evaluating 'foo'
'foo' -> nan
Evaluating 'foo('
'foo(' -> nan
Evaluating 'foo()'
'foo()' -> nan
Evaluating 'foo)'
'foo)' -> nan
Evaluating 'sin'
'sin' -> nan
Evaluating 'sin('
'sin(' -> nan
Evaluating 'sin()'
'sin()' -> nan
Evaluating 'sin)'
'sin)' -> nan
Evaluating 'sin 10'
'sin 10' -> nan
Evaluating 'sin(1,2,3)'
'sin(1,2,3)' -> nan
Evaluating 'sin(1 )'
'sin(1 )' -> 0.841471
Evaluating '1'
'1' -> 1.000000
Evaluating '1foo'
'1foo' -> nan
Evaluating 'bar + PI + E + 100f*2 + foo'
'bar + PI + E + 100f*2 + foo' -> nan
Evaluating '13k + 12f - foo(1, 2)'
'13k + 12f - foo(1, 2)' -> nan
Evaluating '1gi'
'1gi' -> nan
Evaluating '1Gi'
'1Gi' -> 1073741824.000000
Evaluating 'st(0, 123)'
'st(0, 123)' -> 123.000000
Evaluating 'st(1, 123); ld(1)'
'st(1, 123); ld(1)' -> 123.000000
Evaluating 'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)'
'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)' -> 4950.000000
Evaluating 'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)'
'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)' -> 144.000000
Evaluating 'while(0, 10)'
'while(0, 10)' -> nan
Evaluating 'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))'
'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))' -> 100.000000
Evaluating 'isnan(1)'
'isnan(1)' -> 0.000000
Evaluating 'isnan(NAN)'
'isnan(NAN)' -> 1.000000
Evaluating 'floor(NAN)'
'floor(NAN)' -> nan
Evaluating 'floor(123.123)'
'floor(123.123)' -> 123.000000
Evaluating 'floor(-123.123)'
'floor(-123.123)' -> -124.000000
Evaluating 'trunc(123.123)'
'trunc(123.123)' -> 123.000000
Evaluating 'trunc(-123.123)'
'trunc(-123.123)' -> -123.000000
Evaluating 'ceil(123.123)'
'ceil(123.123)' -> 124.000000
Evaluating 'ceil(-123.123)'
'ceil(-123.123)' -> -123.000000
Evaluating 'sqrt(1764)'
'sqrt(1764)' -> 42.000000
Evaluating 'sqrt(-1)'
'sqrt(-1)' -> -nan
Evaluating 'not(1)'
'not(1)' -> 0.000000
Evaluating 'not(NAN)'
'not(NAN)' -> 0.000000
Evaluating 'not(0)'
'not(0)' -> 1.000000
Evaluating 'pow(0,1.23)'
'pow(0,1.23)' -> 0.000000
Evaluating 'pow(PI,1.23)'
'pow(PI,1.23)' -> 4.087844
Evaluating 'PI^1.23'
'PI^1.23' -> 4.087844
Evaluating 'pow(-1,1.23)'
'pow(-1,1.23)' -> -nan
12.700000 == 12.7
0.931323 == 0.931322575
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment