Merge remote-tracking branch 'qatar/master'

* qatar/master:
  vf_hqdn3d: Don't declare the loop variable within the for loop
  huffyuv: update to current coding style
  huffman: update to current coding style
  rtsp: Free the rtpdec context properly
  build: fft: x86: Drop unused YASM-OBJS-FFT- variable

Conflicts:
	libavcodec/huffman.c
	libavcodec/huffyuv.c
	libavcodec/x86/Makefile
	libavfilter/vf_hqdn3d.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/28/head
Michael Niedermayer 12 years ago
commit 4abb88d7e8
  1. 31
      libavcodec/huffman.c
  2. 1109
      libavcodec/huffyuv.c
  3. 6
      libavcodec/x86/Makefile
  4. 2
      libavfilter/vf_hqdn3d.c
  5. 2
      libavformat/rtsp.c

@ -32,24 +32,26 @@
#define HNODE -1
static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat, Node *nodes, int node, uint32_t pfx, int pl, int *pos, int no_zero_count)
static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat,
Node *nodes, int node,
uint32_t pfx, int pl, int *pos, int no_zero_count)
{
int s;
s = nodes[node].sym;
if(s != HNODE || (no_zero_count && !nodes[node].count)){
if (s != HNODE || (no_zero_count && !nodes[node].count)) {
bits[*pos] = pfx;
lens[*pos] = pl;
xlat[*pos] = s;
(*pos)++;
}else{
} else {
pfx <<= 1;
pl++;
get_tree_codes(bits, lens, xlat, nodes, nodes[node].n0, pfx, pl, pos,
no_zero_count);
get_tree_codes(bits, lens, xlat, nodes, nodes[node].n0, pfx, pl,
pos, no_zero_count);
pfx |= 1;
get_tree_codes(bits, lens, xlat, nodes, nodes[node].n0+1, pfx, pl, pos,
no_zero_count);
get_tree_codes(bits, lens, xlat, nodes, nodes[node].n0 + 1, pfx, pl,
pos, no_zero_count);
}
}
@ -61,7 +63,8 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags)
uint8_t xlat[256];
int pos = 0;
get_tree_codes(bits, lens, xlat, nodes, head, 0, 0, &pos, no_zero_count);
get_tree_codes(bits, lens, xlat, nodes, head, 0, 0,
&pos, no_zero_count);
return ff_init_vlc_sparse(vlc, 9, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
}
@ -77,20 +80,22 @@ int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
int cur_node;
int64_t sum = 0;
for(i = 0; i < nb_codes; i++){
for (i = 0; i < nb_codes; i++) {
nodes[i].sym = i;
nodes[i].n0 = -2;
sum += nodes[i].count;
}
if(sum >> 31) {
av_log(avctx, AV_LOG_ERROR, "Too high symbol frequencies. Tree construction is not possible\n");
if (sum >> 31) {
av_log(avctx, AV_LOG_ERROR,
"Too high symbol frequencies. "
"Tree construction is not possible\n");
return -1;
}
qsort(nodes, nb_codes, sizeof(Node), cmp);
cur_node = nb_codes;
nodes[nb_codes*2-1].count = 0;
for(i = 0; i < nb_codes*2-1; i += 2){
for (i = 0; i < nb_codes * 2 - 1; i += 2) {
uint32_t cur_count = nodes[i].count + nodes[i+1].count;
// find correct place to insert new node, and
// make space for the new node while at it
@ -106,7 +111,7 @@ int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
nodes[j].n0 = i;
cur_node++;
}
if(build_huff_tree(vlc, nodes, nb_codes*2-2, flags) < 0){
if (build_huff_tree(vlc, nodes, nb_codes * 2 - 2, flags) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error building tree\n");
return -1;
}

File diff suppressed because it is too large Load Diff

@ -42,11 +42,9 @@ YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o
YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o
YASM-OBJS-$(CONFIG_DCT) += x86/dct32_sse.o
YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o
YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc.o
YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o \
$(YASM-OBJS-FFT-yes)
YASM-OBJS-$(CONFIG_DWT) += x86/dwt_yasm.o
YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc.o
YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o
YASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \
x86/h264_chromamc_10bit.o
YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \

@ -305,7 +305,7 @@ static int config_input(AVFilterLink *inlink)
if (!hqdn3d->line)
return AVERROR(ENOMEM);
for (i=0; i<4; i++) {
for (i = 0; i < 4; i++) {
hqdn3d->coefs[i] = precalc_coefs(hqdn3d->strength[i], hqdn3d->depth);
if (!hqdn3d->coefs[i])
return AVERROR(ENOMEM);

@ -568,7 +568,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
avformat_free_context(rtpctx);
} else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
ff_rdt_parse_close(rtsp_st->transport_priv);
else if (rt->transport == RTSP_TRANSPORT_RAW && CONFIG_RTPDEC)
else if (rt->transport == RTSP_TRANSPORT_RTP && CONFIG_RTPDEC)
ff_rtp_parse_close(rtsp_st->transport_priv);
}
rtsp_st->transport_priv = NULL;

Loading…
Cancel
Save