• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavcodec/

Lines Matching defs:band

179     IVIBandDesc *band;
198 /* select band dimensions: if there is only one band then it
204 /* luma band buffers will be aligned on 16x16 (max macroblock size) */
205 /* chroma band buffers will be aligned on 8x8 (max macroblock size) */
212 band = &planes[p].bands[b]; /* select appropriate plane/band */
213 band->plane = p;
214 band->band_num = b;
215 band->width = b_width;
216 band->height = b_height;
217 band->pitch = width_aligned;
218 band->aheight = height_aligned;
219 band->bufs[0] = av_mallocz(buf_size);
220 band->bufs[1] = av_mallocz(buf_size);
221 if (!band->bufs[0] || !band->bufs[1])
224 /* allocate the 3rd band buffer for scalability mode */
226 band->bufs[2] = av_mallocz(buf_size);
227 if (!band->bufs[2])
261 IVIBandDesc *band;
274 band = &planes[p].bands[b];
275 x_tiles = IVI_NUM_TILES(band->width, t_width);
276 y_tiles = IVI_NUM_TILES(band->height, t_height);
277 band->num_tiles = x_tiles * y_tiles;
279 av_freep(&band->tiles);
280 band->tiles = av_mallocz(band->num_tiles * sizeof(IVITile));
281 if (!band->tiles)
284 tile = band->tiles;
286 /* use the first luma band as reference for motion vectors
290 for (y = 0; y < band->height; y += t_height) {
291 for (x = 0; x < band->width; x += t_width) {
294 tile->mb_size = band->mb_size;
295 tile->width = FFMIN(band->width - x, t_width);
296 tile->height = FFMIN(band->height - y, t_height);
300 band->mb_size);
340 int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
348 RVMapDesc *rvmap = band->rv_map;
355 blk_size = band->blk_size;
357 num_blocks = (band->mb_size != blk_size) ? 4 : 1; /* number of blocks per mb */
372 quant = av_clip(band->glob_quant + mb->q_delta, 0, 23);
374 base_tab = is_intra ? band->intra_base : band->inter_base;
375 scale_tab = is_intra ? band->intra_scale : band->inter_scale;
382 if (!band->is_halfpel) {
392 dmv_x = mb->mv_x >> band->is_halfpel;
393 dmv_y = mb->mv_y >> band->is_halfpel;
394 cx = mb->mv_x & band->is_halfpel;
395 cy = mb->mv_y & band->is_halfpel;
398 || mb->xpos + dmv_x + band->mb_size + cx > band->pitch
400 || mb->ypos + dmv_y + band->mb_size + cy > band->aheight) {
412 buf_offs += blk_size * band->pitch;
416 if (!band->scan) {
426 sym = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1);
431 run = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1) + 1;
432 lo = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1);
433 hi = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1);
448 pos = band->scan[scan_pos];
464 if (is_intra && band->is_2d_trans) {
471 band->inv_transform(trvec, band->buf + buf_offs,
472 band->pitch, col_flags);
476 mc_with_delta_func(band->buf + buf_offs,
477 band->ref_buf + buf_offs + mv_y * band->pitch + mv_x,
478 band->pitch, mc_type);
484 if (band->dc_transform)
485 band->dc_transform(&prev_dc, band->buf + buf_offs,
486 band->pitch, blk_size);
488 mc_no_delta_func(band->buf + buf_offs,
489 band->ref_buf + buf_offs + mv_y * band->pitch + mv_x,
490 band->pitch, mc_type);
507 * @param[in] band pointer to the band descriptor
511 static int ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band,
521 if (tile->num_MBs != IVI_MBs_PER_TILE(tile->width, tile->height, band->mb_size)) {
524 tile->num_MBs, IVI_MBs_PER_TILE(tile->width, tile->height, band->mb_size));
528 offs = tile->ypos * band->pitch + tile->xpos;
531 row_offset = band->mb_size * band->pitch;
534 for (y = tile->ypos; y < (tile->ypos + tile->height); y += band->mb_size) {
537 for (x = tile->xpos; x < (tile->xpos + tile->width); x += band->mb_size) {
545 if (!band->qdelta_present && !band->plane && !band->band_num) {
546 mb->q_delta = band->glob_quant;
551 if (band->inherit_qdelta && ref_mb)
554 if (band->inherit_mv && ref_mb) {
569 mb_offset += band->mb_size;
574 if (band->inherit_mv && need_mc) { /* apply motion compensation if there is at least one non-zero motion vector */
575 num_blocks = (band->mb_size != band->blk_size) ? 4 : 1; /* number of blocks per mb */
576 mc_no_delta_func = (band->blk_size == 8) ? ff_ivi_mc_8x8_no_delta
582 if (!band->is_halfpel) {
592 offs = mb->buf_offs + band->blk_size * ((blk & 1) + !!(blk & 2) * band->pitch);
593 mc_no_delta_func(band->buf + offs,
594 band->ref_buf + offs + mv_y * band->pitch + mv_x,
595 band->pitch, mc_type);
600 src = band->ref_buf + tile->ypos * band->pitch + tile->xpos;
601 dst = band->buf + tile->ypos * band->pitch + tile->xpos;
603 memcpy(dst, src, tile->width*sizeof(band->buf[0]));
604 src += band->pitch;
605 dst += band->pitch;
614 uint16_t ivi_calc_band_checksum (IVIBandDesc *band)
619 src = band->buf;
622 for (y = 0; y < band->height; src += band->pitch, y++)
623 for (x = 0; x < band->width; x++)
629 int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch)
635 src = band->buf;
638 for (y = 0; y < band->height; src += band->pitch, y++) {
639 for (x = 0; x < band->width; x++) {
644 y / band->blk_size, x / band->blk_size);
673 * Decode an Indeo 4 or 5 band.
676 * @param[in,out] band ptr to the band descriptor
681 IVIBandDesc *band, AVCodecContext *avctx)
686 band->buf = band->bufs[ctx->dst_buf];
687 band->ref_buf = band->bufs[ctx->ref_buf];
688 band->data_ptr = ctx->frame_data + (get_bits_count(&ctx->gb) >> 3);
690 result = ctx->decode_band_hdr(ctx, band, avctx);
692 av_log(avctx, AV_LOG_ERROR, "Error while decoding band header: %d\n",
697 if (band->is_empty) {
698 av_log(avctx, AV_LOG_ERROR, "Empty band encountered!\n");
702 band->rv_map = &ctx->rvmap_tabs[band->rvmap_sel];
705 for (i = 0; i < band->num_corr; i++) {
706 idx1 = band->corr[i * 2];
707 idx2 = band->corr[i * 2 + 1];
708 FFSWAP(uint8_t, band->rv_map->runtab[idx1], band->rv_map->runtab[idx2]);
709 FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]);
714 for (t = 0; t < band->num_tiles; t++) {
715 tile = &band->tiles[t];
717 if (tile->mb_size != band->mb_size) {
719 band->mb_size, tile->mb_size);
724 result = ivi_process_empty_tile(avctx, band, tile,
725 (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3));
736 result = ctx->decode_mb_info(ctx, band, tile, avctx);
740 result = ff_ivi_decode_blocks(&ctx->gb, band, tile);
759 for (i = band->num_corr-1; i >= 0; i--) {
760 idx1 = band->corr[i*2];
761 idx2 = band->corr[i*2+1];
762 FFSWAP(uint8_t, band->rv_map->runtab[idx1], band->rv_map->runtab[idx2]);
763 FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]);
767 if (band->checksum_present) {
768 uint16_t chksum = ivi_calc_band_checksum(band);
769 if (chksum != band->checksum) {
771 "Band checksum mismatch! Plane %d, band %d, received: %x, calculated: %x\n",
772 band->plane, band->band_num, band->checksum, chksum);
818 "Error while decoding band: %d, plane: %d\n", b, p);