[soc]: r3802 - in dirac/libavcodec: dirac.c dirac.h dirac_arith.c dirac_arith.h dirac_wavelet.c diracdec.c diracenc.c
Author: conrad Date: Mon Nov 10 04:12:20 2008 New Revision: 3802 Log: Cosmetics: replace double spaces at the end of a comment with a single space Modified: dirac/libavcodec/dirac.c dirac/libavcodec/dirac.h dirac/libavcodec/dirac_arith.c dirac/libavcodec/dirac_arith.h dirac/libavcodec/dirac_wavelet.c dirac/libavcodec/diracdec.c dirac/libavcodec/diracenc.c Modified: dirac/libavcodec/dirac.c ============================================================================== --- dirac/libavcodec/dirac.c (original) +++ dirac/libavcodec/dirac.c Mon Nov 10 04:12:20 2008 @@ -37,7 +37,7 @@ #include "dirac_wavelet.h" #include "mpeg12data.h" -/* Defaults for source parameters. */ +/* Defaults for source parameters. */ static const dirac_source_params dirac_source_parameters_defaults[] = { { 640, 480, 2, 0, 0, 1, 1, 640, 480, 0, 0, 1, 0 }, @@ -96,10 +96,10 @@ static const color_specification dirac_c static const float dirac_preset_kr[] = { 0.2126, 0.299, 0 /* XXX */ }; static const float dirac_preset_kb[] = { 0.0722, 0.114, 0 /* XXX */ }; -/* Weights for qpel/eighth pel interpolation. */ +/* Weights for qpel/eighth pel interpolation. */ typedef uint8_t weights_t[4]; -/* Quarter pixel interpolation. */ +/* Quarter pixel interpolation. */ static const weights_t qpel_weights[] = { { 4, 0, 0, 0 }, /* rx=0, ry=0 */ { 2, 0, 2, 0 }, /* rx=0, ry=1 */ @@ -166,7 +166,7 @@ void dirac_dump_source_parameters(AVCode dprintf(avctx, "Croma offset=%d, Chroma excursion=%d\n", source->chroma_offset, source->chroma_excursion); - /* XXX: This list is incomplete, add the other members. */ + /* XXX: This list is incomplete, add the other members. */ dprintf(avctx, "-----------------------------------------------------\n"); } @@ -178,29 +178,29 @@ static int parse_source_parameters(Dirac { GetBitContext *gb = &s->gb; - /* Override the luma dimensions. */ + /* Override the luma dimensions. */ if (get_bits1(gb)) { s->source.luma_width = svq3_get_ue_golomb(gb); s->source.luma_height = svq3_get_ue_golomb(gb); } - /* Override the chroma format. */ + /* Override the chroma format. */ if (get_bits1(gb)) s->source.chroma_format = svq3_get_ue_golomb(gb); - /* Calculate the chroma dimensions. */ + /* Calculate the chroma dimensions. */ s->chroma_hshift = s->source.chroma_format > 0; s->chroma_vshift = s->source.chroma_format > 1; s->source.chroma_width = s->source.luma_width >> s->chroma_hshift; s->source.chroma_height = s->source.luma_height >> s->chroma_vshift; if (get_bits1(gb)) - /* Interlace. */ + /* Interlace. */ s->source.interlaced = svq3_get_ue_golomb(gb); if (s->source.interlaced > 1) return -1; - /* Framerate. */ + /* Framerate. */ if (get_bits1(gb)) { s->source.frame_rate_index = svq3_get_ue_golomb(gb); @@ -219,7 +219,7 @@ static int parse_source_parameters(Dirac s->source.frame_rate = dirac_frame_rate[s->source.frame_rate_index-9]; } - /* Override aspect ratio. */ + /* Override aspect ratio. */ if (get_bits1(gb)) { s->source.aspect_ratio_index = svq3_get_ue_golomb(gb); @@ -235,7 +235,7 @@ static int parse_source_parameters(Dirac s->source.aspect_ratio = dirac_preset_aspect_ratios[s->source.aspect_ratio_index-1]; - /* Override clean area. */ + /* Override clean area. */ if (get_bits1(gb)) { s->source.clean_width = svq3_get_ue_golomb(gb); s->source.clean_height = svq3_get_ue_golomb(gb); @@ -243,7 +243,7 @@ static int parse_source_parameters(Dirac s->source.clean_right_offset = svq3_get_ue_golomb(gb); } - /* Override signal range. */ + /* Override signal range. */ if (get_bits1(gb)) { s->source.signal_range_index = svq3_get_ue_golomb(gb); @@ -265,7 +265,7 @@ static int parse_source_parameters(Dirac s->source.chroma_excursion = dirac_preset_chroma_excursion[idx]; } - /* Color spec. */ + /* Color spec. */ s->source.color_spec = dirac_color_spec_presets[s->source.color_spec_index]; if (get_bits1(gb)) { s->source.color_spec_index = svq3_get_ue_golomb(gb); @@ -276,7 +276,7 @@ static int parse_source_parameters(Dirac s->source.color_spec = dirac_color_spec_presets[s->source.color_spec_index]; if (! s->source.color_spec_index) { - /* Color primaries. */ + /* Color primaries. */ if (get_bits1(gb)) { unsigned int primaries_idx = svq3_get_ue_golomb(gb); @@ -286,7 +286,7 @@ static int parse_source_parameters(Dirac s->source.color_spec.primaries = primaries_idx; } - /* Override matrix. */ + /* Override matrix. */ if (get_bits1(gb)) { unsigned int matrix_idx = svq3_get_ue_golomb(gb); @@ -296,7 +296,7 @@ static int parse_source_parameters(Dirac s->source.color_spec.matrix = matrix_idx; } - /* Transfer function. */ + /* Transfer function. */ if (get_bits1(gb)) { unsigned int tf_idx = svq3_get_ue_golomb(gb); @@ -327,14 +327,14 @@ int ff_dirac_parse_sequence_header(Dirac unsigned int video_format; unsigned int picture_coding_mode; - /* Parse parameters. */ + /* Parse parameters. */ version_major = svq3_get_ue_golomb(gb); version_minor = svq3_get_ue_golomb(gb); /* XXX: Don't check the version yet, existing encoders do not yet - set this to a sane value (0.6 at the moment). */ + set this to a sane value (0.6 at the moment). */ /* XXX: Not yet documented in the spec. This is actually the main - thing that is missing. */ + thing that is missing. */ s->profile = svq3_get_ue_golomb(gb); s->level = svq3_get_ue_golomb(gb); dprintf(s->avctx, "Access unit header: Version %d.%d\n", @@ -347,10 +347,10 @@ int ff_dirac_parse_sequence_header(Dirac if (video_format > 20) return -1; - /* Fill in defaults for the source parameters. */ + /* Fill in defaults for the source parameters. */ s->source = dirac_source_parameters_defaults[video_format]; - /* Override the defaults. */ + /* Override the defaults. */ if (parse_source_parameters(s)) return -1; @@ -542,7 +542,7 @@ static void interpolate_frame_halfpel(AV lineout += doutwidth; } - /* Copy top even lines. */ + /* Copy top even lines. */ linein = pixels + ypad * doutwidth; lineout = pixels; for (y = 0; y < ypad * 2; y += 2) { @@ -550,7 +550,7 @@ static void interpolate_frame_halfpel(AV lineout += doutwidth; } - /* Copy bottom even lines. */ + /* Copy bottom even lines. */ linein = pixels + (ypad + height - 1) * doutwidth; lineout = linein + doutwidth; for (y = 0; y < ypad * 2; y += 2) { @@ -558,7 +558,7 @@ static void interpolate_frame_halfpel(AV lineout += doutwidth; } - /* Interpolation (vertically). */ + /* Interpolation (vertically). */ linein = pixelsdata; lineout = pixelsdata + outwidth; for (y = 0; y < height; y++) { @@ -588,11 +588,11 @@ static void interpolate_frame_halfpel(AV linein += doutwidth; - /* Skip one line, we are interpolating to odd lines. */ + /* Skip one line, we are interpolating to odd lines. */ lineout += doutwidth; } - /* Add padding on the left and right sides of the frame. */ + /* Add padding on the left and right sides of the frame. */ lineout = pixels + 2 * ypad * outwidth; for (y = 0; y < height * 2; y++) { memset(lineout, lineout[2 * xpad], 2 * xpad); @@ -601,7 +601,7 @@ static void interpolate_frame_halfpel(AV lineout += outwidth; } - /* Interpolation (horizontally). */ + /* Interpolation (horizontally). */ lineout = pixelsdata + 1; linein = pixelsdata; for (y = 0; y < height * 2; y++) { @@ -628,7 +628,7 @@ static void interpolate_frame_halfpel(AV linein += outwidth; } - /* Add padding to right side of the frame. */ + /* Add padding to right side of the frame. */ lineout = pixels + 2 * ypad * outwidth; for (y = 0; y < height * 2; y++) { memset(&lineout[2 * width + xpad * 2], @@ -636,7 +636,7 @@ static void interpolate_frame_halfpel(AV lineout += outwidth; } - /* Copy top lines. */ + /* Copy top lines. */ linein = pixels + ypad * doutwidth; lineout = pixels; for (y = 0; y < ypad * 2; y++) { @@ -644,7 +644,7 @@ static void interpolate_frame_halfpel(AV lineout += outwidth; } - /* Copy bottom lines. */ + /* Copy bottom lines. */ linein = pixels + (ypad + height - 1) * doutwidth; lineout = linein + outwidth; for (y = 0; y < ypad * 2; y++) { @@ -711,7 +711,7 @@ static void motion_comp_block2refs(Dirac int refxstart1, refystart1; int refxstart2, refystart2; uint16_t *spatialwt; - /* Subhalfpixel in qpel/eighthpel interpolated frame. */ + /* Subhalfpixel in qpel/eighthpel interpolated frame. */ int rx1, ry1, rx2, ry2; const uint8_t *w1 = NULL; const uint8_t *w2 = NULL; @@ -777,7 +777,7 @@ static void motion_comp_block2refs(Dirac spatialwt = &s->spatialwt[s->xblen * (ys - ystart)]; /* Make sure the vector doesn't point to a block outside the - padded frame. */ + padded frame. */ refystart1 = av_clip(refystart1, -s->yblen, s->height * 2 - 1); refystart2 = av_clip(refystart2, -s->yblen, s->height * 2 - 1); if (refxstart1 < -s->xblen) @@ -800,25 +800,25 @@ static void motion_comp_block2refs(Dirac int val; if (s->decoding.mv_precision == 0) { - /* No interpolation. */ + /* No interpolation. */ val1 = refline1[(x + vect1[0]) << 1]; val2 = refline2[(x + vect2[0]) << 1]; } else if (s->decoding.mv_precision == 1) { - /* Halfpel interpolation. */ + /* Halfpel interpolation. */ val1 = refline1[(x << 1) + vect1[0]]; val2 = refline2[(x << 1) + vect2[0]]; } else { - /* Position in halfpel interpolated frame. */ + /* Position in halfpel interpolated frame. */ int hx1, hx2; if (s->decoding.mv_precision == 2) { - /* Do qpel interpolation. */ + /* Do qpel interpolation. */ hx1 = ((x << 2) + vect1[0]) >> 1; hx2 = ((x << 2) + vect2[0]) >> 1; val1 = 2; val2 = 2; } else { - /* Do eighthpel interpolation. */ + /* Do eighthpel interpolation. */ hx1 = ((x << 3) + vect1[0]) >> 2; hx2 = ((x << 3) + vect2[0]) >> 2; val1 = 4; @@ -827,7 +827,7 @@ static void motion_comp_block2refs(Dirac /* Fix the x position on the halfpel interpolated frame so it points to a MC block within the padded - region. */ + region. */ hx1 += xfix1; hx2 += xfix2; @@ -897,7 +897,7 @@ static void motion_comp_block1ref(DiracC int vect[2]; int refxstart, refystart; uint16_t *spatialwt; - /* Subhalfpixel in qpel/eighthpel interpolated frame. */ + /* Subhalfpixel in qpel/eighthpel interpolated frame. */ int rx, ry; const uint8_t *w = NULL; int xfix = 0; @@ -942,7 +942,7 @@ static void motion_comp_block1ref(DiracC } /* Make sure the vector doesn't point to a block outside the - padded frame. */ + padded frame. */ refystart = av_clip(refystart, -s->yblen * 2, s->height * 2 - 1); if (refxstart < -s->xblen * 2) xfix = -s->xblen - refxstart; @@ -959,28 +959,28 @@ static void motion_comp_block1ref(DiracC int val; if (s->decoding.mv_precision == 0) { - /* No interpolation. */ + /* No interpolation. */ val = refline[(x + vect[0]) << 1]; } else if (s->decoding.mv_precision == 1) { - /* Halfpel interpolation. */ + /* Halfpel interpolation. */ val = refline[(x << 1) + vect[0]]; } else { - /* Position in halfpel interpolated frame. */ + /* Position in halfpel interpolated frame. */ int hx; if (s->decoding.mv_precision == 2) { - /* Do qpel interpolation. */ + /* Do qpel interpolation. */ hx = ((x << 2) + vect[0]) >> 1; val = 2; } else { - /* Do eighthpel interpolation. */ + /* Do eighthpel interpolation. */ hx = ((x << 3) + vect[0]) >> 2; val = 4; } /* Fix the x position on the halfpel interpolated frame so it points to a MC block within the padded - region. */ + region. */ hx += xfix; val += w[0] * refline[hx ]; @@ -1116,7 +1116,7 @@ int dirac_motion_compensation(DiracConte return -1; } - /* Set up the spatial weighting matrix. */ + /* Set up the spatial weighting matrix. */ for (x = 0; x < s->xblen; x++) { for (y = 0; y < s->yblen; y++) { int wh, wv; @@ -1184,7 +1184,7 @@ int dirac_motion_compensation(DiracConte int padding; /* XXX: These calculations do not match those in the - Dirac specification, but are correct. */ + Dirac specification, but are correct. */ xstart = i * s->xbsep - s->xoffset; ystart = j * s->ybsep - s->yoffset; xstop = FFMIN(xstart + s->xblen, s->width); @@ -1202,19 +1202,19 @@ int dirac_motion_compensation(DiracConte motion_comp_dc_block(s, s->mcpic, i, j, xstart, xstop, ystart, ystop, block->dc[comp], border); - /* Reference frame 1 only. */ + /* Reference frame 1 only. */ else if ((block->use_ref & 3) == DIRAC_REF_MASK_REF1) motion_comp_block1ref(s, s->mcpic, i, j, xstart, xstop, ystart, ystop,s->refdata[0] + padding, 0, block, comp, border); - /* Reference frame 2 only. */ + /* Reference frame 2 only. */ else if ((block->use_ref & 3) == DIRAC_REF_MASK_REF2) motion_comp_block1ref(s, s->mcpic, i, j, xstart, xstop, ystart, ystop, s->refdata[1] + padding, 1, block, comp, border); - /* Both reference frames. */ + /* Both reference frames. */ else motion_comp_block2refs(s, s->mcpic, i, j, xstart, xstop, ystart, ystop, Modified: dirac/libavcodec/dirac.h ============================================================================== --- dirac/libavcodec/dirac.h (original) +++ dirac/libavcodec/dirac.h Mon Nov 10 04:12:20 2008 @@ -67,20 +67,20 @@ typedef struct { typedef struct { - /* Information about the frames. */ + /* Information about the frames. */ unsigned int luma_width; ///< the luma component width unsigned int luma_height; ///< the luma component height /** Choma format: 0: 4:4:4, 1: 4:2:2, 2: 4:2:0 */ unsigned int chroma_format; - /* Interlacing. */ + /* Interlacing. */ char interlaced; ///< flag for interlacing char top_field_first; unsigned int frame_rate_index; ///< index into dirac_frame_rate[] unsigned int aspect_ratio_index; ///< index into dirac_aspect_ratio[] - /* Clean area. */ + /* Clean area. */ uint16_t clean_width; uint16_t clean_height; uint16_t clean_left_offset; @@ -89,7 +89,7 @@ typedef struct { unsigned int signal_range_index; ///< index into dirac_signal_range[] unsigned int color_spec_index; ///< index into ff_dirac_color_spec_presets[] - /* Calculated: */ + /* Calculated: */ unsigned int chroma_width; ///< the chroma component width unsigned int chroma_height; ///< the chroma component height unsigned int luma_depth; @@ -98,7 +98,7 @@ typedef struct { AVRational frame_rate; AVRational aspect_ratio; - /* Luma and chroma offsets. */ + /* Luma and chroma offsets. */ uint16_t luma_offset; uint16_t luma_excursion; uint16_t chroma_offset; @@ -188,8 +188,8 @@ typedef struct DiracContext { struct decoding_parameters decoding; unsigned int codeblock_mode; - unsigned int codeblocksh[7]; /* XXX: 7 levels. */ - unsigned int codeblocksv[7]; /* XXX: 7 levels. */ + unsigned int codeblocksh[7]; /* XXX: 7 levels. */ + unsigned int codeblocksv[7]; /* XXX: 7 levels. */ int padded_luma_width; ///< padded luma width int padded_luma_height; ///< padded luma height @@ -219,7 +219,7 @@ typedef struct DiracContext { unsigned int wavelet_idx; - /* Current component. */ + /* Current component. */ int padded_width; ///< padded width of the current component int padded_height; ///< padded height of the current component int width; @@ -237,7 +237,7 @@ typedef struct DiracContext { int *sbsplit; // XXX: int8_t struct dirac_blockmotion *blmotion; - /** State of arithmetic decoding. */ + /** State of arithmetic decoding. */ struct dirac_arith_state arith; } DiracContext; @@ -355,7 +355,7 @@ static inline int zero_neighbourhood(DiracContext *s, int16_t *data, int v, int h) { /* Check if there is a zero to the left and top left of this - coefficient. */ + coefficient. */ if (v > 0 && (data[-s->padded_width] || ( h > 0 && data[-s->padded_width - 1]))) return 0; @@ -397,10 +397,10 @@ int intra_dc_coeff_prediction(DiracConte if (pred > 0) pred = (pred + 1) / 3; else /* XXX: For now just do what the reference - implementation does. Check this. */ + implementation does. Check this. */ pred = -((-pred)+1)/3; } else if (x > 0) { - /* Just use the coefficient left of this one. */ + /* Just use the coefficient left of this one. */ pred = coeff[-1]; } else if (y > 0) pred = coeff[-s->padded_width]; @@ -456,7 +456,7 @@ int mode_prediction(DiracContext *s, int return ((s->blmotion[(y - 1) * s->blwidth + x ].use_ref & refmask) >> refshift); - /* Return the majority. */ + /* Return the majority. */ cnt = (s->blmotion[ y * s->blwidth + x - 1].use_ref & refmask) + (s->blmotion[(y - 1) * s->blwidth + x ].use_ref & refmask) + (s->blmotion[(y - 1) * s->blwidth + x - 1].use_ref & refmask); @@ -484,31 +484,31 @@ int motion_vector_prediction(DiracContex if (x > 0) { /* Test if the block to the left has a motion vector for this - reference frame. */ + reference frame. */ if ((block[-1].use_ref & mask) == refmask) { left = block[-1].vect[ref][dir]; cnt++; } - /* This is the only reference, return it. */ + /* This is the only reference, return it. */ if (y == 0) return left; } if (y > 0) { /* Test if the block above the current one has a motion vector - for this reference frame. */ + for this reference frame. */ if ((block[-s->blwidth].use_ref & mask) == refmask) { top = block[-s->blwidth].vect[ref][dir]; cnt++; } - /* This is the only reference, return it. */ + /* This is the only reference, return it. */ if (x == 0) return top; else if (x > 0) { /* Test if the block above the current one has a motion vector - for this reference frame. */ + for this reference frame. */ if ((block[-s->blwidth - 1].use_ref & mask) == refmask) { lefttop = block[-s->blwidth - 1].vect[ref][dir]; cnt++; @@ -516,18 +516,18 @@ int motion_vector_prediction(DiracContex } } - /* No references for the prediction. */ + /* No references for the prediction. */ if (cnt == 0) return 0; if (cnt == 1) return left + top + lefttop; - /* Return the median of two motion vectors. */ + /* Return the median of two motion vectors. */ if (cnt == 2) return (left + top + lefttop + 1) >> 1; - /* Return the median of three motion vectors. */ + /* Return the median of three motion vectors. */ return mid_pred(left, top, lefttop); } @@ -565,7 +565,7 @@ int block_dc_prediction(DiracContext *s, sign = FFSIGN(total); total = FFABS(total); - /* Return the average of all DC values that were counted. */ + /* Return the average of all DC values that were counted. */ return sign * (total + (cnt >> 1)) / cnt; } Modified: dirac/libavcodec/dirac_arith.c ============================================================================== --- dirac/libavcodec/dirac_arith.c (original) +++ dirac/libavcodec/dirac_arith.c Mon Nov 10 04:12:20 2008 @@ -69,7 +69,7 @@ static void dirac_arith_init_common(dira arith->low = 0; arith->range = 0xFFFF; - /* Initialize contexts. */ + /* Initialize contexts. */ for (i = 0; i < ARITH_CONTEXT_COUNT; i++) { arith->contexts[i] = 0x8000; } @@ -182,7 +182,7 @@ void dirac_arith_put_bit(dirac_arith_sta arith->contexts[context] -= arith_lookup[arith->contexts[context] >> 8]; } - /* Renormalisation and output. */ + /* Renormalisation and output. */ while (arith->range <= 0x4000) { if (((arith->low + arith->range - 1)^arith->low) >= 0x8000) { arith->low ^= 0x4000; @@ -305,7 +305,7 @@ void dirac_arith_coder_flush(dirac_arith int rem; assert(!arith->gb); - /* Output remaining resolved msbs. */ + /* Output remaining resolved msbs. */ while (((arith->low + arith->range - 1)^arith->low) < 0x8000) { put_bits(arith->pb, 1, (arith->low >> 15)&1); while (arith->carry > 0) { @@ -317,7 +317,7 @@ void dirac_arith_coder_flush(dirac_arith arith->range <<= 1; } - /* Resolve remaining straddle conditions. */ + /* Resolve remaining straddle conditions. */ while ((arith->low & 0x4000) && !((arith->low + arith->range - 1) & 0x4000)) { arith->carry++; @@ -327,12 +327,12 @@ void dirac_arith_coder_flush(dirac_arith arith->low &= 0xFFFF; } - /* Discharge carry bits. */ + /* Discharge carry bits. */ put_bits(arith->pb, 1, (arith->low >> 14)&1); for (i = 0; i <= arith->carry; i++) put_bits(arith->pb, 1, !((arith->low >> 14)&1)); - /* Add padding bits. */ + /* Add padding bits. */ rem = 8 - (put_bits_count(arith->pb) % 8); for (i = 0; i < rem; i++) put_bits(arith->pb, 1, 0); @@ -358,7 +358,7 @@ void dirac_arith_test(void) { int i, c; int length; - /* Code the string. */ + /* Code the string. */ init_put_bits(&pb, buf, sizeof(buf)*8); dirac_arith_coder_init(&arith, &pb); for (c = 0; c < sizeof(in); c++) { @@ -384,7 +384,7 @@ void dirac_arith_test(void) { flush_put_bits(&pb); length = put_bits_count(&pb); - /* Now decode the string. */ + /* Now decode the string. */ init_get_bits(&gb, buf, sizeof(buf)*8); dirac_arith_init(&arith, &gb, length); for(c = 0; 1; c++) { Modified: dirac/libavcodec/dirac_arith.h ============================================================================== --- dirac/libavcodec/dirac_arith.h (original) +++ dirac/libavcodec/dirac_arith.h Mon Nov 10 04:12:20 2008 @@ -76,7 +76,7 @@ enum arith_context_indices { }; typedef struct dirac_arith_state { - /* Arithmetic decoding. */ + /* Arithmetic decoding. */ unsigned int low; unsigned int range; unsigned int code; Modified: dirac/libavcodec/dirac_wavelet.c ============================================================================== --- dirac/libavcodec/dirac_wavelet.c (original) +++ dirac/libavcodec/dirac_wavelet.c Mon Nov 10 04:12:20 2008 @@ -49,7 +49,7 @@ static void dirac_subband_idwt_interleav int16_t *line_hl = data + width; int16_t *line_hh = data + height * padded_width + width; - /* Interleave the coefficients. */ + /* Interleave the coefficients. */ for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { synth_line[(x << 1) ] = line_ll[x]; @@ -78,7 +78,7 @@ static void dirac_subband_dwt_deinterlea int16_t *line_hl = data + width; int16_t *line_hh = data + height * padded_width + width; - /* Deinterleave the coefficients. */ + /* Deinterleave the coefficients. */ for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { line_ll[x] = synth_line[(x << 1) ]; @@ -114,7 +114,7 @@ int dirac_subband_idwt_53(AVCodecContext dirac_subband_idwt_interleave(data, width, height, padded_width, synth, level); - /* Vertical synthesis: Lifting stage 1. */ + /* Vertical synthesis: Lifting stage 1. */ synthline = synth; for (x = 0; x < synth_width; x++) { synthline[x] -= (synthline[synth_width + x] @@ -137,7 +137,7 @@ int dirac_subband_idwt_53(AVCodecContext + 2) >> 2; } - /* Vertical synthesis: Lifting stage 2. */ + /* Vertical synthesis: Lifting stage 2. */ synthline = synth + synth_width; for (x = 0; x < synth_width; x++) synthline[x] += (synthline[x - synth_width] @@ -158,11 +158,11 @@ int dirac_subband_idwt_53(AVCodecContext + synthline[x - synth_width] + 1) >> 1; - /* Horizontal synthesis. */ + /* Horizontal synthesis. */ synthline = synth; for (y = 0; y < synth_height; y++) { - /* Lifting stage 1. */ + /* Lifting stage 1. */ synthline[0] -= (synthline[1] + synthline[1] + 2) >> 2; @@ -238,7 +238,7 @@ int dirac_subband_dwt_53(AVCodecContext } /* Shift in one bit that is used for additional precision and copy - the data to the buffer. */ + the data to the buffer. */ synthline = synth; dataline = data; for (y = 0; y < synth_height; y++) { @@ -248,11 +248,11 @@ int dirac_subband_dwt_53(AVCodecContext dataline += padded_width; } - /* Horizontal synthesis. */ + /* Horizontal synthesis. */ synthline = synth; dataline = data; for (y = 0; y < synth_height; y++) { - /* Lifting stage 2. */ + /* Lifting stage 2. */ for (x = 0; x < width - 1; x++) { synthline[2 * x + 1] -= (synthline[2 * x] + synthline[2 * x + 2] @@ -261,7 +261,7 @@ int dirac_subband_dwt_53(AVCodecContext synthline[synth_width - 1] -= (synthline[synth_width - 2] + synthline[synth_width - 2] + 1) >> 1; - /* Lifting stage 1. */ + /* Lifting stage 1. */ synthline[0] += (synthline[1] + synthline[1] + 2) >> 2; @@ -278,7 +278,7 @@ int dirac_subband_dwt_53(AVCodecContext dataline += padded_width; } - /* Vertical synthesis: Lifting stage 2. */ + /* Vertical synthesis: Lifting stage 2. */ synthline = synth + synth_width; for (x = 0; x < synth_width; x++) synthline[x] -= (synthline[x - synth_width] @@ -299,7 +299,7 @@ int dirac_subband_dwt_53(AVCodecContext + synthline[x - synth_width] + 1) >> 1; - /* Vertical synthesis: Lifting stage 1. */ + /* Vertical synthesis: Lifting stage 1. */ synthline = synth; for (x = 0; x < synth_width; x++) { synthline[x] += (synthline[synth_width + x] @@ -350,7 +350,7 @@ int dirac_subband_idwt_97(AVCodecContext dirac_subband_idwt_interleave(data, width, height, padded_width, synth, level); - /* Vertical synthesis: Lifting stage 1. */ + /* Vertical synthesis: Lifting stage 1. */ synthline = synth; for (x = 0; x < synth_width; x++) synthline[x] -= (synthline[x + synth_width] @@ -371,7 +371,7 @@ int dirac_subband_idwt_97(AVCodecContext + synthline[x + synth_width] + 2) >> 2; - /* Vertical synthesis: Lifting stage 2. */ + /* Vertical synthesis: Lifting stage 2. */ synthline = synth + synth_width; for (x = 0; x < synth_width; x++) synthline[x] += (- synthline[x - synth_width] @@ -404,10 +404,10 @@ int dirac_subband_idwt_97(AVCodecContext + 8) >> 4; } - /* Horizontal synthesis. */ + /* Horizontal synthesis. */ synthline = synth; for (y = 0; y < synth_height; y++) { - /* Lifting stage 1. */ + /* Lifting stage 1. */ synthline[0] -= (synthline[1] + synthline[1] + 2) >> 2; @@ -424,7 +424,7 @@ int dirac_subband_idwt_97(AVCodecContext + 2) >> 2; data[synth_width - 2] = (synthline[synth_width - 2] + 1) >> 1; - /* Lifting stage 2. */ + /* Lifting stage 2. */ synthline[1] += (- synthline[0] + 9 * synthline[0] + 9 * synthline[2] @@ -486,7 +486,7 @@ int dirac_subband_dwt_97(AVCodecContext } /* Shift in one bit that is used for additional precision and copy - the data to the buffer. */ + the data to the buffer. */ synthline = synth; dataline = data; for (y = 0; y < synth_height; y++) { @@ -496,10 +496,10 @@ int dirac_subband_dwt_97(AVCodecContext dataline += padded_width; } - /* Horizontal synthesis. */ + /* Horizontal synthesis. */ synthline = synth; for (y = 0; y < synth_height; y++) { - /* Lifting stage 2. */ + /* Lifting stage 2. */ synthline[1] -= (- synthline[0] + 9 * synthline[0] + 9 * synthline[2] @@ -522,7 +522,7 @@ int dirac_subband_dwt_97(AVCodecContext + 9 * synthline[synth_width - 2] - synthline[synth_width - 2] + 8) >> 4; - /* Lifting stage 1. */ + /* Lifting stage 1. */ synthline[0] += (synthline[1] + synthline[1] + 2) >> 2; @@ -538,7 +538,7 @@ int dirac_subband_dwt_97(AVCodecContext synthline += synth_width; } - /* Vertical synthesis: Lifting stage 2. */ + /* Vertical synthesis: Lifting stage 2. */ synthline = synth + synth_width; for (x = 0; x < synth_width; x++) synthline[x] -= (- synthline[x - synth_width] @@ -571,7 +571,7 @@ int dirac_subband_dwt_97(AVCodecContext + 8) >> 4; } - /* Vertical synthesis: Lifting stage 1. */ + /* Vertical synthesis: Lifting stage 1. */ synthline = synth; for (x = 0; x < synth_width; x++) synthline[x] += (synthline[x + synth_width] Modified: dirac/libavcodec/diracdec.c ============================================================================== --- dirac/libavcodec/diracdec.c (original) +++ dirac/libavcodec/diracdec.c Mon Nov 10 04:12:20 2008 @@ -100,17 +100,17 @@ static void coeff_unpack(DiracContext *s coeffp = &data[hdata + vdata * s->padded_width]; - /* The value of the pixel belonging to the lower level. */ + /* The value of the pixel belonging to the lower level. */ if (level >= 2) { int x = coeff_posx(s, level - 1, orientation, h >> 1); int y = coeff_posy(s, level - 1, orientation, v >> 1); parent = data[s->padded_width * y + x] != 0; } - /* Determine if the pixel has only zeros in its neighbourhood. */ + /* Determine if the pixel has only zeros in its neighbourhood. */ nhood = zero_neighbourhood(s, coeffp, v, h); - /* Calculate an index into context_sets_waveletcoeff. */ + /* Calculate an index into context_sets_waveletcoeff. */ idx = parent * 6 + (!nhood) * 3; idx += sign_predict(s, coeffp, orientation, v, h); @@ -153,7 +153,7 @@ static void codeblock(DiracContext *s, i bottom = (subband_height(s, level) * (y + 1)) / s->codeblocksv[level]; if (!blockcnt_one) { - /* Determine if this codeblock is a zero block. */ + /* Determine if this codeblock is a zero block. */ if (dirac_arith_get_bit(&s->arith, ARITH_CONTEXT_ZERO_BLOCK)) return; } @@ -266,7 +266,7 @@ static int dirac_unpack_prediction_param { GetBitContext *gb = &s->gb; - /* Read block parameters. */ + /* Read block parameters. */ unsigned int idx = svq3_get_ue_golomb(gb); if (idx > 4) @@ -285,29 +285,29 @@ static int dirac_unpack_prediction_param } /* Setup the blen and bsep parameters for the chroma - component. */ + component. */ s->decoding.chroma_xblen = s->decoding.luma_xblen >> s->chroma_hshift; s->decoding.chroma_yblen = s->decoding.luma_yblen >> s->chroma_vshift; s->decoding.chroma_xbsep = s->decoding.luma_xbsep >> s->chroma_hshift; s->decoding.chroma_ybsep = s->decoding.luma_ybsep >> s->chroma_vshift; - /* Read motion vector precision. */ + /* Read motion vector precision. */ s->decoding.mv_precision = svq3_get_ue_golomb(gb); - /* Read the global motion compensation parameters. */ + /* Read the global motion compensation parameters. */ s->globalmc_flag = get_bits1(gb); if (s->globalmc_flag) { int ref; for (ref = 0; ref < s->refs; ref++) { memset(&s->globalmc, 0, sizeof(s->globalmc)); - /* Pan/til parameters. */ + /* Pan/til parameters. */ if (get_bits1(gb)) { s->globalmc.pan_tilt[0] = dirac_get_se_golomb(gb); s->globalmc.pan_tilt[1] = dirac_get_se_golomb(gb); } - /* Rotation/shear parameters. */ + /* Rotation/shear parameters. */ if (get_bits1(gb)) { s->globalmc.zrs_exp = svq3_get_ue_golomb(gb); s->globalmc.zrs[0][0] = dirac_get_se_golomb(gb); @@ -319,7 +319,7 @@ static int dirac_unpack_prediction_param s->globalmc.zrs[1][1] = 1; } - /* Perspective parameters. */ + /* Perspective parameters. */ if (get_bits1(gb)) { s->globalmc.perspective_exp = svq3_get_ue_golomb(gb); s->globalmc.perspective[0] = dirac_get_se_golomb(gb); @@ -329,7 +329,7 @@ static int dirac_unpack_prediction_param } /* Picture prediction mode. Not used yet in the specification, so - just ignore it, it should and will be zero. */ + just ignore it, it should and will be zero. */ svq3_get_ue_golomb(gb); /* Default weights */ @@ -337,7 +337,7 @@ static int dirac_unpack_prediction_param s->decoding.picture_weight_ref1 = 1; s->decoding.picture_weight_ref2 = 1; - /* Override reference picture weights. */ + /* Override reference picture weights. */ if (get_bits1(gb)) { s->decoding.picture_weight_precision = svq3_get_ue_golomb(gb); s->decoding.picture_weight_ref1 = dirac_get_se_golomb(gb); @@ -375,11 +375,11 @@ static void blockmode_prediction(DiracCo */ static void blockglob_prediction(DiracContext *s, int x, int y) { - /* Global motion compensation is not used at all. */ + /* Global motion compensation is not used at all. */ if (!s->globalmc_flag) return; - /* Global motion compensation is not used for this block. */ + /* Global motion compensation is not used for this block. */ if (s->blmotion[y * s->blwidth + x].use_ref & 3) { int res = dirac_arith_get_bit(&s->arith, ARITH_CONTEXT_GLOBAL_BLOCK); res ^= mode_prediction(s, x, y, DIRAC_REF_MASK_GLOBAL, 2); @@ -399,7 +399,7 @@ static void propagate_block_data(DiracCo int i, j; /* XXX: For now this is rather inefficient, because everything is - copied. This function is called quite often. */ + copied. This function is called quite often. */ for (j = y; j < y + step; j++) for (i = x; i < x + step; i++) s->blmotion[j * s->blwidth + i] = s->blmotion[y * s->blwidth + x]; @@ -433,7 +433,7 @@ static void dirac_unpack_motion_vector(D const int refmask = (ref + 1) | DIRAC_REF_MASK_GLOBAL; /* First determine if for this block in the specific reference - frame a motion vector is required. */ + frame a motion vector is required. */ if ((s->blmotion[y * s->blwidth + x].use_ref & refmask) != ref + 1) return; @@ -508,7 +508,7 @@ static int dirac_unpack_block_motion_dat return -1; } - /* Superblock splitmodes. */ + /* Superblock splitmodes. */ length = svq3_get_ue_golomb(gb); dirac_arith_init(&s->arith, gb, length); for (y = 0; y < s->sbheight; y++) @@ -519,7 +519,7 @@ static int dirac_unpack_block_motion_dat } dirac_arith_flush(&s->arith); - /* Prediction modes. */ + /* Prediction modes. */ length = svq3_get_ue_golomb(gb); dirac_arith_init(&s->arith, gb, length); for (y = 0; y < s->sbheight; y++) @@ -539,15 +539,15 @@ static int dirac_unpack_block_motion_dat } dirac_arith_flush(&s->arith); - /* Unpack the motion vectors. */ + /* Unpack the motion vectors. */ for (i = 0; i < s->refs; i++) { dirac_unpack_motion_vectors(s, i, 0); dirac_unpack_motion_vectors(s, i, 1); } - /* Unpack the DC values for all the three components (YUV). */ + /* Unpack the DC values for all the three components (YUV). */ for (comp = 0; comp < 3; comp++) { - /* Unpack the DC values. */ + /* Unpack the DC values. */ length = svq3_get_ue_golomb(gb); dirac_arith_init(&s->arith, gb, length); for (y = 0; y < s->sbheight; y++) @@ -581,13 +581,13 @@ static void decode_component(DiracContex int level; subband_t orientation; - /* Align for coefficient bitstream. */ + /* Align for coefficient bitstream. */ align_get_bits(gb); - /* Unpack LL, level 0. */ + /* Unpack LL, level 0. */ subband_dc(s, coeffs); - /* Unpack all other subbands at all levels. */ + /* Unpack all other subbands at all levels. */ for (level = 1; level <= s->decoding.wavelet_depth; level++) { for (orientation = 1; orientation <= subband_hh; orientation++) subband(s, coeffs, level, orientation); @@ -657,7 +657,7 @@ static int dirac_decode_frame_internal(D return -1; } - /* Allocate memory for the IDWT to work in. */ + /* Allocate memory for the IDWT to work in. */ synth = av_malloc(s->padded_luma_width * s->padded_luma_height * sizeof(int16_t)); if (!synth) { @@ -699,7 +699,7 @@ static int dirac_decode_frame_internal(D } /* Copy the decoded coefficients into the frame and also add - the data calculated by MC. */ + the data calculated by MC. */ line = coeffs; if (s->refs) { mcline = s->mcpic; @@ -725,7 +725,7 @@ static int dirac_decode_frame_internal(D } } - /* XXX: Just (de)allocate this once. */ + /* XXX: Just (de)allocate this once. */ av_freep(&s->mcpic); } @@ -758,7 +758,7 @@ static int parse_frame(DiracContext *s) for (i = 0; i < s->refs; i++) s->ref[i] = dirac_get_se_golomb(gb) + s->picnum; - /* Retire the reference frames that are not used anymore. */ + /* Retire the reference frames that are not used anymore. */ s->retirecnt = 0; if (s->picture.reference) { retire = dirac_get_se_golomb(gb); @@ -779,7 +779,7 @@ static int parse_frame(DiracContext *s) align_get_bits(gb); - /* Wavelet transform data. */ + /* Wavelet transform data. */ if (s->refs == 0) s->zero_res = 0; else @@ -809,7 +809,7 @@ static int parse_frame(DiracContext *s) #define CALC_PADDING(size, depth) \ (((size + (1 << depth) - 1) >> depth) << depth) - /* Round up to a multiple of 2^depth. */ + /* Round up to a multiple of 2^depth. */ s->padded_luma_width = CALC_PADDING(s->source.luma_width, s->decoding.wavelet_depth); s->padded_luma_height = CALC_PADDING(s->source.luma_height, @@ -834,7 +834,7 @@ int dirac_decode_frame(AVCodecContext *a if (buf_size == 0) { int idx = dirac_reference_frame_idx(s, avctx->frame_number); if (idx == -1) { - /* The frame was not found. */ + /* The frame was not found. */ *data_size = 0; } else { *data_size = sizeof(AVFrame); @@ -855,7 +855,7 @@ int dirac_decode_frame(AVCodecContext *a if (ff_dirac_parse_sequence_header(s)) return -1; - /* Dump the header. */ + /* Dump the header. */ #if 0 dirac_dump_source_parameters(avctx); #endif @@ -863,7 +863,7 @@ int dirac_decode_frame(AVCodecContext *a return 0; } - /* If this is not a picture, return. */ + /* If this is not a picture, return. */ if ((parse_code & 0x08) != 0x08) return 0; @@ -921,7 +921,7 @@ int dirac_decode_frame(AVCodecContext *a } /* Retire frames that were reordered and displayed if they are no - reference frames either. */ + reference frames either. */ for (i = 0; i < s->refcnt; i++) { AVFrame *f = &s->refframes[i].frame; @@ -943,7 +943,7 @@ int dirac_decode_frame(AVCodecContext *a } f = &s->refframes[idx].frame; - /* Do not retire frames that were not displayed yet. */ + /* Do not retire frames that were not displayed yet. */ if (f->display_picture_number >= avctx->frame_number) { f->reference = 0; continue; @@ -967,7 +967,7 @@ int dirac_decode_frame(AVCodecContext *a int idx; if (!s->picture.reference) { - /* This picture needs to be shown at a later time. */ + /* This picture needs to be shown at a later time. */ s->refframes[s->refcnt].halfpel[0] = 0; s->refframes[s->refcnt].halfpel[1] = 0; @@ -977,7 +977,7 @@ int dirac_decode_frame(AVCodecContext *a idx = dirac_reference_frame_idx(s, avctx->frame_number); if (idx == -1) { - /* The frame is not yet decoded. */ + /* The frame is not yet decoded. */ *data_size = 0; } else { *data_size = sizeof(AVFrame); Modified: dirac/libavcodec/diracenc.c ============================================================================== --- dirac/libavcodec/diracenc.c (original) +++ dirac/libavcodec/diracenc.c Mon Nov 10 04:12:20 2008 @@ -42,7 +42,7 @@ static int encode_init(AVCodecContext *a DiracContext *s = avctx->priv_data; av_log_set_level(AV_LOG_DEBUG); - /* XXX: Choose a better size somehow. */ + /* XXX: Choose a better size somehow. */ s->encodebuf = av_malloc(1 << 20); if (!s->encodebuf) { @@ -73,7 +73,7 @@ int dirac_dwt(DiracContext *s, int16_t * int level; int width, height; - /* XXX: make depth configurable. */ + /* XXX: make depth configurable. */ for (level = s->frame_decoding.wavelet_depth; level >= 1; level--) { width = subband_width(s, level); height = subband_height(s, level); @@ -93,7 +93,7 @@ static void dirac_encode_parse_info(Dira { put_bits(&s->pb, 32, DIRAC_PARSE_INFO_PREFIX); put_bits(&s->pb, 8, parsecode); - /* XXX: These will be filled in after encoding. */ + /* XXX: These will be filled in after encoding. */ put_bits(&s->pb, 32, 0); put_bits(&s->pb, 32, 0); } @@ -107,11 +107,11 @@ static void dirac_encode_sequence_parame seqdef = &dirac_sequence_parameters_defaults[video_format]; - /* Fill in defaults for the sequence parameters. */ + /* Fill in defaults for the sequence parameters. */ s->sequence = *seqdef; /* Fill in the sequence parameters using the information set by - the user. XXX: Only support YUV420P for now. */ + the user. XXX: Only support YUV420P for now. */ seq->luma_width = avctx->width; seq->luma_height = avctx->height; seq->chroma_width = avctx->width / 2; @@ -120,11 +120,11 @@ static void dirac_encode_sequence_parame seq->chroma_format = 2; /* Set video format to 0. In the future a best match is perhaps - better. */ + better. */ dirac_set_ue_golomb(&s->pb, video_format); - /* Override image dimensions. */ + /* Override image dimensions. */ if (seq->luma_width != seqdef->luma_width || seq->luma_height != seqdef->luma_height) { put_bits(&s->pb, 1, 1); @@ -135,17 +135,17 @@ static void dirac_encode_sequence_parame put_bits(&s->pb, 1, 0); } - /* Override chroma format. */ + /* Override chroma format. */ if (seq->chroma_format != seqdef->chroma_format) { put_bits(&s->pb, 1, 1); - /* XXX: Hardcoded to 4:2:0. */ + /* XXX: Hardcoded to 4:2:0. */ dirac_set_ue_golomb(&s->pb, 2); } else { put_bits(&s->pb, 1, 0); } - /* Override video depth. */ + /* Override video depth. */ if (seq->video_depth != seqdef->video_depth) { put_bits(&s->pb, 1, 1); @@ -164,11 +164,11 @@ static void dirac_encode_source_paramete sourcedef = &dirac_source_parameters_defaults[video_format]; - /* Fill in defaults for the source parameters. */ + /* Fill in defaults for the source parameters. */ s->source = *sourcedef; /* Fill in the source parameters using the information set by the - user. XXX: No support for interlacing. */ + user. XXX: No support for interlacing. */ source->interlaced = 0; source->frame_rate.num = avctx->time_base.den; source->frame_rate.den = avctx->time_base.num; @@ -176,13 +176,13 @@ static void dirac_encode_source_paramete if (avctx->sample_aspect_ratio.num != 0) source->aspect_ratio = avctx->sample_aspect_ratio; - /* Override interlacing options. */ + /* Override interlacing options. */ if (source->interlaced != sourcedef->interlaced) { put_bits(&s->pb, 1, 1); put_bits(&s->pb, 1, source->interlaced); - /* Override top field first flag. */ + /* Override top field first flag. */ if (source->top_field_first != sourcedef->top_field_first) { put_bits(&s->pb, 1, 1); @@ -192,7 +192,7 @@ static void dirac_encode_source_paramete put_bits(&s->pb, 1, 0); } - /* Override sequential fields flag. */ + /* Override sequential fields flag. */ if (source->sequential_fields != sourcedef->sequential_fields) { put_bits(&s->pb, 1, 1); @@ -206,12 +206,12 @@ static void dirac_encode_source_paramete put_bits(&s->pb, 1, 0); } - /* Override frame rate. */ + /* Override frame rate. */ if (av_cmp_q(source->frame_rate, sourcedef->frame_rate) != 0) { put_bits(&s->pb, 1, 1); /* XXX: Some default frame rates can be used. For now just - set the index to 0 and write the frame rate. */ + set the index to 0 and write the frame rate. */ dirac_set_ue_golomb(&s->pb, 0); dirac_set_ue_golomb(&s->pb, source->frame_rate.num); @@ -220,12 +220,12 @@ static void dirac_encode_source_paramete put_bits(&s->pb, 1, 0); } - /* Override aspect ratio. */ + /* Override aspect ratio. */ if (av_cmp_q(source->aspect_ratio, sourcedef->aspect_ratio) != 0) { put_bits(&s->pb, 1, 1); /* XXX: Some default aspect ratios can be used. For now just - set the index to 0 and write the aspect ratio. */ + set the index to 0 and write the aspect ratio. */ dirac_set_ue_golomb(&s->pb, 0); dirac_set_ue_golomb(&s->pb, source->aspect_ratio.num); @@ -234,7 +234,7 @@ static void dirac_encode_source_paramete put_bits(&s->pb, 1, 0); } - /* Override clean area. */ + /* Override clean area. */ if (source->clean_width != sourcedef->clean_width || source->clean_height != sourcedef->clean_height || source->clean_left_offset != sourcedef->clean_left_offset @@ -249,7 +249,7 @@ static void dirac_encode_source_paramete put_bits(&s->pb, 1, 0); } - /* Override signal range. */ + /* Override signal range. */ if (source->luma_offset != sourcedef->luma_offset || source->luma_excursion != sourcedef->luma_excursion || source->chroma_offset != sourcedef->chroma_offset @@ -257,7 +257,7 @@ static void dirac_encode_source_paramete put_bits(&s->pb, 1, 1); /* XXX: Some default signal ranges can be used. For now just - set the index to 0 and write the signal range. */ + set the index to 0 and write the signal range. */ dirac_set_ue_golomb(&s->pb, 0); dirac_set_ue_golomb(&s->pb, source->luma_offset); @@ -268,15 +268,15 @@ static void dirac_encode_source_paramete put_bits(&s->pb, 1, 0); } - /* Override color spec. */ + /* Override color spec. */ /* XXX: For now this won't be overridden at all. Just set this to - defaults. */ + defaults. */ put_bits(&s->pb, 1, 0); } static void dirac_encode_access_unit_header(DiracContext *s) { - /* First write the Access Unit Parse Parameters. */ + /* First write the Access Unit Parse Parameters. */ dirac_set_ue_golomb(&s->pb, 0); /* version major */ dirac_set_ue_golomb(&s->pb, 1); /* version minor */ @@ -285,7 +285,7 @@ static void dirac_encode_access_unit_hea dirac_encode_sequence_parameters(s); dirac_encode_source_parameters(s); - /* Fill in defaults for the decoding parameters. */ + /* Fill in defaults for the decoding parameters. */ s->decoding = dirac_decoding_parameters_defaults[0]; } @@ -308,25 +308,25 @@ static void encode_coeff(DiracContext *s coeffp = &coeffs[xpos + ypos * s->padded_width]; coeff = *coeffp; - /* The value of the pixel belonging to the lower level. */ + /* The value of the pixel belonging to the lower level. */ if (level >= 2) { int px = coeff_posx(s, level - 1, orientation, x >> 1); int py = coeff_posy(s, level - 1, orientation, y >> 1); parent = coeffs[s->padded_width * py + px] != 0; } - /* Determine if the pixel has only zeros in its neighbourhood. */ + /* Determine if the pixel has only zeros in its neighbourhood. */ nhood = zero_neighbourhood(s, coeffp, y, x); - /* Calculate an index into context_sets_waveletcoeff. */ + /* Calculate an index into context_sets_waveletcoeff. */ idx = parent * 6 + (!nhood) * 3; idx += sign_predict(s, coeffp, orientation, y, x); context = &dirac_context_sets_waveletcoeff[idx]; - /* XXX: Quantization. */ + /* XXX: Quantization. */ - /* Write out the coefficient. */ + /* Write out the coefficient. */ dirac_arith_write_int(&s->arith, context, coeff); } @@ -375,7 +375,7 @@ static void intra_dc_coding(DiracContext /* Just do the inverse of intra_dc_prediction. Start at the right bottom corner and remove the predicted value from the - coefficient, the decoder can easily reconstruct this. */ + coefficient, the decoder can easily reconstruct this. */ for (y = subband_height(s, 0) - 1; y >= 0; y--) { for (x = subband_width(s, 0) - 1; x >= 0; x--) { @@ -404,7 +404,7 @@ void dirac_arithblk_writedata(DiracConte length = put_bits_count(pb) / 8; align_put_bits(&s->pb); - /* XXX: Use memmove. */ + /* XXX: Use memmove. */ flush_put_bits(&s->pb); buf = pbBufPtr(&s->pb); memcpy(buf, s->encodebuf, length); @@ -417,7 +417,7 @@ static int encode_subband(DiracContext * int xpos, ypos; PutBitContext pb; - /* Encode the data. */ + /* Encode the data. */ init_put_bits(&pb, s->encodebuf, (1 << 20) * 8); dirac_arith_coder_init(&s->arith, &pb); @@ -431,7 +431,7 @@ static int encode_subband(DiracContext * dirac_arithblk_writelen(s, &pb); - /* Write quantizer index. XXX: No quantization? */ + /* Write quantizer index. XXX: No quantization? */ dirac_set_ue_golomb(&s->pb, 0); dirac_arithblk_writedata(s, &pb); @@ -473,14 +473,14 @@ static int dirac_encode_component(DiracC } } - /* Subtract motion compensated data to calculate the residue. */ + /* Subtract motion compensated data to calculate the residue. */ if (s->refs) { int x, y; int16_t *coeffline; int16_t *mcline; /* Calculate the data that should be subtracted from the - pixels to produce the residue. */ + pixels to produce the residue. */ if (dirac_motion_compensation(s, coeffs, comp)) { av_freep(&s->sbsplit); av_freep(&s->blmotion); @@ -545,11 +545,11 @@ static void blockmode_encode(DiracContex static void blockglob_encode(DiracContext *s, int x, int y) { - /* Global motion compensation is not used at all. */ + /* Global motion compensation is not used at all. */ if (!s->globalmc_flag) return; - /* Global motion compensation is not used for this block. */ + /* Global motion compensation is not used for this block. */ if (s->blmotion[y * s->blwidth + x].use_ref & 3) { int res = (s->blmotion[y * s->blwidth + x].use_ref & DIRAC_REF_MASK_GLOBAL) >> 2; @@ -565,7 +565,7 @@ static void dirac_pack_motion_vector(Dir const int refmask = (ref + 1) | DIRAC_REF_MASK_GLOBAL; /* First determine if for this block in the specific reference - frame a motion vector is required. */ + frame a motion vector is required. */ if ((s->blmotion[y * s->blwidth + x].use_ref & refmask) != ref + 1) return; @@ -628,7 +628,7 @@ static int dirac_encode_blockdata(DiracC s->blheight = s->sbheight << 2; /* XXX: This should be done before calling this function, but for - now it is more convenient to do this here. */ + now it is more convenient to do this here. */ s->sbsplit = av_mallocz(s->sbwidth * s->sbheight * sizeof(int)); if (!s->sbsplit) { av_log(s->avctx, AV_LOG_ERROR, "avcodec_check_dimensions() failed\n"); @@ -643,7 +643,7 @@ static int dirac_encode_blockdata(DiracC } /* XXX: Fill the Motion Vectors with semi-random data for - testing. */ + testing. */ for (x = 0; x < s->blwidth; x++) { for (y = 0; y < s->blheight; y++) { struct dirac_blockmotion *bl = &s->blmotion[y * s->blwidth + x]; @@ -666,7 +666,7 @@ static int dirac_encode_blockdata(DiracC } /* Superblock splitmodes. XXX: Just (for now) encode "2", so that - blocks are not split at all. */ + blocks are not split at all. */ init_put_bits(&pb, s->encodebuf, (1 << 20) * 8); dirac_arith_coder_init(&s->arith, &pb); for (y = 0; y < s->sbheight; y++) @@ -676,7 +676,7 @@ static int dirac_encode_blockdata(DiracC res = s->sbsplit[y * s->sbwidth + x] - split_prediction(s, x, y); /* This should be unsigned, because this is under modulo - 3, it is ok to add 3. */ + 3, it is ok to add 3. */ if (res < 0) res += 3; @@ -685,7 +685,7 @@ static int dirac_encode_blockdata(DiracC dirac_arithblk_writelen(s, &pb); dirac_arithblk_writedata(s, &pb); - /* Prediction modes. */ + /* Prediction modes. */ init_put_bits(&pb, s->encodebuf, (1 << 20) * 8); dirac_arith_coder_init(&s->arith, &pb); for (y = 0; y < s->sbheight; y++) @@ -707,15 +707,15 @@ static int dirac_encode_blockdata(DiracC dirac_arithblk_writelen(s, &pb); dirac_arithblk_writedata(s, &pb); - /* Pack the motion vectors. */ + /* Pack the motion vectors. */ for (i = 0; i < s->refs; i++) { dirac_pack_motion_vectors(s, i, 0); dirac_pack_motion_vectors(s, i, 1); } - /* Unpack the DC values for all the three components (YUV). */ + /* Unpack the DC values for all the three components (YUV). */ for (comp = 0; comp < 3; comp++) { - /* Unpack the DC values. */ + /* Unpack the DC values. */ init_put_bits(&pb, s->encodebuf, (1 << 20) * 8); dirac_arith_coder_init(&s->arith, &pb); for (y = 0; y < s->sbheight; y++) @@ -743,22 +743,22 @@ static int dirac_pack_prediction_paramet { PutBitContext *pb = &s->pb; - /* Use default block parameters. */ + /* Use default block parameters. */ put_bits(pb, 1, 0); /* Motion vector precision: Use qpel interpolation (2 bits - precision) for now. */ + precision) for now. */ put_bits(pb, 1, 1); dirac_set_ue_golomb(pb, 2); - /* Do not use Global Motion Estimation. */ + /* Do not use Global Motion Estimation. */ put_bits(pb, 1, 0); /* Do not encode the picture prediction mode, this is not yet - used. */ + used. */ put_bits(pb, 1, 0); - /* Use default weights for the reference frames. */ + /* Use default weights for the reference frames. */ put_bits(pb, 1, 0); s->chroma_hshift = s->sequence.chroma_format > 0; @@ -787,7 +787,7 @@ static int dirac_encode_frame(DiracConte s->frame_decoding = s->decoding; - /* Round up to a multiple of 2^depth. */ + /* Round up to a multiple of 2^depth. */ s->padded_luma_width = CALC_PADDING(s->sequence.luma_width, s->frame_decoding.wavelet_depth); s->padded_luma_height = CALC_PADDING(s->sequence.luma_height, @@ -797,7 +797,7 @@ static int dirac_encode_frame(DiracConte s->padded_chroma_height = CALC_PADDING(s->sequence.chroma_height, s->frame_decoding.wavelet_depth); - /* Set defaults for the codeblocks. */ + /* Set defaults for the codeblocks. */ for (i = 0; i <= s->frame_decoding.wavelet_depth; i++) { if (s->refs == 0) { s->codeblocksh[i] = i <= 2 ? 1 : 4; @@ -816,19 +816,19 @@ static int dirac_encode_frame(DiracConte } } - /* Write picture header. */ + /* Write picture header. */ s->picnum = s->avctx->frame_number - 1; put_bits(pb, 32, s->picnum); for (i = 0; i < s->refs; i++) dirac_set_se_golomb(pb, s->ref[i] - s->picnum); - /* Write retire pictures list. */ + /* Write retire pictures list. */ if (s->refcnt == 0) { dirac_set_ue_golomb(pb, 0); } else if (s->refs == 0) { /* This is a new intra frame, remove all old reference - frames. */ + frames. */ dirac_set_ue_golomb(pb, 1); dirac_set_se_golomb(pb, s->refframes[0].frame.display_picture_number - s->picnum); @@ -836,7 +836,7 @@ static int dirac_encode_frame(DiracConte dirac_set_ue_golomb(pb, 0); } - /* Pack the ME data. */ + /* Pack the ME data. */ if (s->refs) { align_put_bits(pb); if (dirac_pack_prediction_parameters(s)) @@ -848,39 +848,39 @@ static int dirac_encode_frame(DiracConte align_put_bits(pb); - /* Wavelet transform parameters. */ + /* Wavelet transform parameters. */ if (s->refs == 0) { s->zero_res = 0; } else { - /* XXX: Actually, calculate if the residue is zero. */ + /* XXX: Actually, calculate if the residue is zero. */ s->zero_res = 0; put_bits(pb, 1, 0); } - /* Do not override default filter. */ + /* Do not override default filter. */ put_bits(pb, 1, 1); /* Set the default filter to LeGall for inter frames and - Deslauriers-Debuc for intra frames. */ + Deslauriers-Debuc for intra frames. */ if (s->refs) dirac_set_ue_golomb(pb, 1); else dirac_set_ue_golomb(pb, 0); - /* Do not override the default depth. */ + /* Do not override the default depth. */ put_bits(pb, 1, 0); - /* Use spatial partitioning. */ + /* Use spatial partitioning. */ put_bits(pb, 1, 1); - /* Do not override spatial partitioning. */ + /* Do not override spatial partitioning. */ put_bits(pb, 1, 0); - /* Codeblock mode. */ + /* Codeblock mode. */ dirac_set_ue_golomb(pb, 0); - /* Write the transform data. */ + /* Write the transform data. */ for (comp = 0; comp < 3; comp++) { if (dirac_encode_component(s, comp)) return -1; @@ -942,7 +942,7 @@ static int encode_frame(AVCodecContext * avcodec_get_frame_defaults(&f); avcodec_get_frame_defaults(&s->picture); - /* Use the decoder to create the reference frame. */ + /* Use the decoder to create the reference frame. */ decsize = dirac_decode_frame(avctx, &f, &data_size, buf, size); if (decsize == -1) return -1;
participants (1)
-
conrad