type
stringclasses
5 values
content
stringlengths
9
163k
functions
void codeblock(DiracContext *s, SubBand *b, GetBitContext *gb, DiracArith *c, int left, int right, int top, int bottom, int blockcnt_one, int is_arith) { int x, y, zero_block; int qoffset, qfactor; IDWTELEM *buf; /* ...
functions
void intra_dc_prediction(SubBand *b) { IDWTELEM *buf = b->ibuf; int x, y; for (x = 1; x < b->width; x++) buf[x] += buf[x-1]; buf += b->stride; for (y = 1; y < b->height; y++) { buf[0] += buf[-b->stride]; for (x = 1; x < b->width; x++) { int pred = buf[x - 1] + ...
functions
void decode_subband_internal(DiracContext *s, SubBand *b, int is_arith) { int cb_x, cb_y, left, right, top, bottom; DiracArith c; GetBitContext gb; int cb_width = s->codeblock[b->level + (b->orientation != subband_ll)].width; int cb_height = s->codeblock[b->level + (b->orientation != subband_ll)].h...
functions
int decode_subband_arith(AVCodecContext *avctx, void *b) { DiracContext *s = avctx->priv_data; decode_subband_internal(s, b, 1); return 0; }
functions
int decode_subband_golomb(AVCodecContext *avctx, void *arg) { DiracContext *s = avctx->priv_data; SubBand **b = arg; decode_subband_internal(s, *b, 0); return 0; }
functions
void decode_component(DiracContext *s, int comp) { AVCodecContext *avctx = s->avctx; SubBand *bands[3*MAX_DWT_LEVELS+1]; enum dirac_subband orientation; int level, num_bands = 0; /* Unpack all subbands at all levels. */ for (level = 0; level < s->wavelet_depth; level++) { for (orientati...
functions
void lowdelay_subband(DiracContext *s, GetBitContext *gb, int quant, int slice_x, int slice_y, int bits_end, SubBand *b1, SubBand *b2) { int left = b1->width * slice_x / s->lowdelay.num_x; int right = b1->width *(slice_x+1) / s->lowdelay.num_x; ...
functions
int decode_lowdelay_slice(AVCodecContext *avctx, void *arg) { DiracContext *s = avctx->priv_data; struct lowdelay_slice *slice = arg; GetBitContext *gb = &slice->gb; enum dirac_subband orientation; int level, quant, chroma_bits, chroma_end; int quant_base = get_bits(gb, 7); /*[DIRAC_STD] qinde...
functions
int decode_lowdelay(DiracContext *s) { AVCodecContext *avctx = s->avctx; int slice_x, slice_y, bytes, bufsize; const uint8_t *buf; struct lowdelay_slice *slices; int slice_num = 0; slices = av_mallocz_array(s->lowdelay.num_x, s->lowdelay.num_y * sizeof(struct lowdelay_slice)); if (!slices) ...
functions
void init_planes(DiracContext *s) { int i, w, h, level, orientation; for (i = 0; i < 3; i++) { Plane *p = &s->plane[i]; p->width = s->source.width >> (i ? s->chroma_x_shift : 0); p->height = s->source.height >> (i ? s->chroma_y_shift : 0); p->idwt_width = w = CALC_...
functions
int dirac_unpack_prediction_parameters(DiracContext *s) { static const uint8_t default_blen[] = { 4, 12, 16, 24 }
functions
int dirac_unpack_idwt_params(DiracContext *s) { GetBitContext *gb = &s->gb; int i, level; unsigned tmp; tmp = svq3_get_ue_golomb(gb); \ if (cond) { \ av_log(s->avctx, AV_LOG_ERROR, errmsg); \ return AVERROR_INVALIDDATA; \ }
functions
int pred_sbsplit(uint8_t *sbsplit, int stride, int x, int y) { static const uint8_t avgsplit[7] = { 0, 0, 1, 1, 1, 2, 2 }
functions
int pred_block_mode(DiracBlock *block, int stride, int x, int y, int refmask) { int pred; if (!(x|y)) return 0; else if (!y) return block[-1].ref & refmask; else if (!x) return block[-stride].ref & refmask; /* return the majority */ pred = (block[-1].ref & refmask) + (b...
functions
void pred_block_dc(DiracBlock *block, int stride, int x, int y) { int i, n = 0; memset(block->u.dc, 0, sizeof(block->u.dc)); if (x && !(block[-1].ref & 3)) { for (i = 0; i < 3; i++) block->u.dc[i] += block[-1].u.dc[i]; n++; }
functions
else if (n == 3) { for (i = 0; i < 3; i++) block->u.dc[i] = divide3(block->u.dc[i]); }
functions
void pred_mv(DiracBlock *block, int stride, int x, int y, int ref) { int16_t *pred[3]; int refmask = ref+1; int mask = refmask | DIRAC_REF_MASK_GLOBAL; /* exclude gmc blocks */ int n = 0; if (x && (block[-1].ref & mask) == refmask) pred[n++] = block[-1].u.mv[ref]; if (y && (block[-str...
functions
void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref) { int ez = s->globalmc[ref].zrs_exp; int ep = s->globalmc[ref].perspective_exp; int (*A)[2] = s->globalmc[ref].zrs; int *b = s->globalmc[ref].pan_tilt; int *c = s->globalmc[ref].perspective; int m ...
functions
void decode_block_params(DiracContext *s, DiracArith arith[8], DiracBlock *block, int stride, int x, int y) { int i; block->ref = pred_block_mode(block, stride, x, y, DIRAC_REF_MASK_REF1); block->ref ^= dirac_get_arith_bit(arith, CTX_PMODE_REF1); if (s->num_refs == 2) ...
functions
void propagate_block_data(DiracBlock *block, int stride, int size) { int x, y; DiracBlock *dst = block; for (x = 1; x < size; x++) dst[x] = *block; for (y = 1; y < size; y++) { dst += stride; for (x = 0; x < size; x++) dst[x] = *block; }
functions
int dirac_unpack_block_motion_data(DiracContext *s) { GetBitContext *gb = &s->gb; uint8_t *sbsplit = s->sbsplit; int i, x, y, q, p; DiracArith arith[8]; align_get_bits(gb); /* [DIRAC_STD] 11.2.4 and 12.2.1 Number of blocks and superblocks */ s->sbwidth = DIVRNDUP(s->source.width, 4*s->pl...
functions
int weight(int i, int blen, int offset) { (1 + (6*(i) + offset - 1) / (2*offset - 1)) if (i < 2*offset) return ROLLOFF(i); else if (i > blen-1 - 2*offset) return ROLLOFF(blen-1 - i); return 8; }
functions
void init_obmc_weight_row(Plane *p, uint8_t *obmc_weight, int stride, int left, int right, int wy) { int x; for (x = 0; left && x < p->xblen >> 1; x++) obmc_weight[x] = wy*8; for (; x < p->xblen >> right; x++) obmc_weight[x] = wy*weight(x, p->xblen, p->xoffse...
functions
void init_obmc_weight(Plane *p, uint8_t *obmc_weight, int stride, int left, int right, int top, int bottom) { int y; for (y = 0; top && y < p->yblen >> 1; y++) { init_obmc_weight_row(p, obmc_weight, stride, left, right, 8); obmc_weight += stride; }
functions
void init_obmc_weights(DiracContext *s, Plane *p, int by) { int top = !by; int bottom = by == s->blheight-1; /* don't bother re-initing for rows 2 to blheight-2, the weights don't change */ if (top || bottom || by == 1) { init_obmc_weight(p, s->obmc_weight[0], MAX_BLOCKSIZE, 1, 0, top, bottom);...
functions
int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5], int x, int y, int ref, int plane) { Plane *p = &s->plane[plane]; uint8_t **ref_hpel = s->ref_pics[ref]->hpel[plane]; int motion_x = block->u.mv[ref][0]; int motion_y = block->u.mv[ref][1]; int mx, my, i, ep...
functions
void add_dc(uint16_t *dst, int dc, int stride, uint8_t *obmc_weight, int xblen, int yblen) { int x, y; dc += 128; for (y = 0; y < yblen; y++) { for (x = 0; x < xblen; x += 2) { dst[x ] += dc * obmc_weight[x ]; dst[x+1] += dc * obmc_weight[x+1]; }
functions
void block_mc(DiracContext *s, DiracBlock *block, uint16_t *mctmp, uint8_t *obmc_weight, int plane, int dstx, int dsty) { Plane *p = &s->plane[plane]; const uint8_t *src[5]; int idx; switch (block->ref&3) { case 0: /* DC */ add_dc(mctmp, block->u.dc...
functions
void mc_row(DiracContext *s, DiracBlock *block, uint16_t *mctmp, int plane, int dsty) { Plane *p = &s->plane[plane]; int x, dstx = p->xbsep - p->xoffset; block_mc(s, block, mctmp, s->obmc_weight[0], plane, -p->xoffset, dsty); mctmp += p->xbsep; for (x = 1; x < s->blwidth-1; x++) { block_mc...
functions
void select_dsp_funcs(DiracContext *s, int width, int height, int xblen, int yblen) { int idx = 0; if (xblen > 8) idx = 1; if (xblen > 16) idx = 2; memcpy(s->put_pixels_tab, s->diracdsp.put_dirac_pixels_tab[idx], sizeof(s->put_pixels_tab)); memcpy(s->avg_pixels_tab, s->diracdsp.avg_...
functions
void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height) { /* chroma allocates an edge of 8 when subsampled which for 4:2:2 means an h edge of 16 and v edge of 8 just use 8 for everything for the moment */ int i, edge = EDGE_WIDTH/2; ref->hpel[plane][0] = ...
functions
int dirac_decode_frame_internal(DiracContext *s) { DWTContext d; int y, i, comp, dsty; int ret; if (s->low_delay) { /* [DIRAC_STD] 13.5.1 low_delay_transform_data() */ for (comp = 0; comp < 3; comp++) { Plane *p = &s->plane[comp]; memset(p->idwt_buf, 0, p->idwt_s...
functions
int get_buffer_with_edge(AVCodecContext *avctx, AVFrame *f, int flags) { int ret, i; int chroma_x_shift, chroma_y_shift; avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, &chroma_y_shift); f->width = avctx->width + 2 * EDGE_WIDTH; f->height = avctx->height + 2 * EDGE_WIDTH + 2; r...
functions
int dirac_decode_picture_header(DiracContext *s) { unsigned retire, picnum; int i, j, ret; int64_t refdist, refnum; GetBitContext *gb = &s->gb; /* [DIRAC_STD] 11.1.1 Picture Header. picture_header() PICTURE_NUM */ picnum = s->current_picture->avframe->display_picture_number = get_bits_long(gb, ...
functions
int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame) { DiracFrame *out = s->delay_frames[0]; int i, out_idx = 0; int ret; /* find frame with lowest picture number */ for (i = 1; s->delay_frames[i]; i++) if (s->delay_frames[i]->avframe->display_picture_number < out->avfram...
functions
int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int size) { DiracContext *s = avctx->priv_data; DiracFrame *pic = NULL; int ret, i, parse_code; unsigned tmp; if (size < DATA_UNIT_HEADER_SIZE) return AVERROR_INVALIDDATA; parse_code = buf[4]; init_get_bits(...
functions
else if (parse_code == pc_eos) { /* [DIRAC_STD] End of Sequence */ free_sequence_buffers(s); s->seen_sequence_header = 0; }
functions
else if (parse_code == pc_aux_data) { if (buf[13] == 1) { /* encoder implementation/version */ int ver[3]; /* versions older than 1.0.8 don't store quant delta for subbands with only one codeblock */ if (sscanf(buf+14, "Schroedinger %d.%d.%d", ver, ver+1, v...
functions
else if (parse_code & 0x8) { /* picture data unit */ if (!s->seen_sequence_header) { av_log(avctx, AV_LOG_DEBUG, "Dropping frame without sequence header\n"); return AVERROR_INVALIDDATA; }
functions
int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt) { DiracContext *s = avctx->priv_data; AVFrame *picture = data; uint8_t *buf = pkt->data; int buf_size = pkt->size; int i, buf_idx = 0; int ret; unsigned data_unit_size; /* ...
functions
else if (s->current_picture->avframe->display_picture_number == s->frame_number) { /* The right frame at the right time :-) */ if((ret=av_frame_ref(data, s->current_picture->avframe)) < 0) return ret; *got_frame = 1; }
includes
#include <bsp/bsp.h>
includes
#include <bsp/cpu.h>
includes
#include <bsp/hex-utils.h>
includes
#include <board.h>
includes
#include <unistd.h>
includes
#include <stdlib.h>
includes
#include <monitor.h>
includes
#include <ledit.h>
includes
#include <string.h>
includes
#include <ctype.h>
includes
#include <cyg/hal/hal_stub.h>
defines
#define MAXLINELEN 80
defines
#define MAXLINES 23
defines
#define PROVIDE_CRASH_CMD 0
defines
#define DEFAULT_SIZE 1
defines
#define REGVALID_VAL regtab[i].registervalid
defines
#define REGVALID_VAL 1
defines
#define REGVALID_VAL regtab[i].registervalid
defines
#define REGVALID_VAL 1
functions
if defined(NVRAM_ETH_ADDR) {NULL, "ethaddr", ethaddr_cmd}
functions
if defined(NVRAM_IP_ADDR) {NULL, "ipaddr", ipaddr_cmd}
functions
if defined(NVRAM_TCP_PORT) {NULL, "tcpport", tcpport_cmd}
functions
int alias_compare (char *cmd) { int m = 0; int match = -1; int num_matches = 0; while (cmdtab[m].cmd != NULL) { if (cmdtab[m].alias != NULL && !strcmp (cmd, cmdtab[m].alias)) { match = m; num_matches++; /* We're expecting that aliases will be defined uniquely, but just in case, we l...
functions
int command_compare (char *cmd) { int m = 0; int match = -1; int num_matches = 0; int cmdlen = strlen(cmd) ; while (cmdtab[m].cmd != NULL) { if (!(strncmp (cmd,cmdtab[m].cmd, cmdlen))) { /* we found a match */ num_matches++; if (num_matches == 2) /* we found a second match */ { ...
functions
void usage (char *string) { xprintf ("Usage: %s\n", string); }
functions
void short_help (char *string) { xprintf ("%s\n", string); }
functions
void long_help (char *string) { int linecnt = 0; int do_leave = 0; for (; *string && !do_leave; string++) { xprintf ("%c", *string); if (*string == '\n') { linecnt++; if (linecnt == MAXLINES) { int i; xprintf ("-More-"); while ((i = input_char ()) >= 0) { i...
functions
else if (i == ' ') { linecnt = 0; break; }
functions
else if (i == 'q' || i == 'Q') { do_leave = 1; break; }
functions
void example (char *example) { xprintf ("Example: %s\n", example); }
functions
void no_help (void) { xprintf ("No help available.\n"); }
functions
void no_help_usage (void) { xprintf ("Incorrect usage.\n"); }
functions
int help_cmd (cmdmode_t mode) { int command_number = -2; if (mode == USAGE) { usage ("help [command]"); return 0; }
functions
int crash_cmd(cmdmode_t mode) { switch (mode) { case USAGE : usage("crash") ; break ; case SHORT_HELP : short_help("invoke the breakpoint function"); break ; case LONG_HELP : long_help("The crash command calls the breakpoint function() which is useful\n\ only if you are using an additiona...
functions
int history_cmd(cmdmode_t mode) { switch (mode) { case USAGE : usage("history") ; break ; case SHORT_HELP : short_help("Print help about line editing features."); break ; case INVOCATION : printHistoryList(); break; case LONG_HELP : long_help("Cygmon line editing allows ...
functions
int othernames_cmd (cmdmode_t mode) { if (mode == USAGE) { usage ("othernames"); return 0; }
functions
int ethaddr_cmd (cmdmode_t mode) { int i, n; unsigned char addr[6]; char *p; if (mode == USAGE) { usage ("ethaddr [xx:xx:xx:xx:xx:xx]"); return 0; }
functions
int ipaddr_cmd (cmdmode_t mode) { int i, j, n; unsigned char addr[4]; char *p; if (mode == USAGE) { usage ("ipaddr [n.n.n.n]"); return 0; }
functions
int tcpport_cmd (cmdmode_t mode) { int n; char *p; if (mode == USAGE) { usage ("ethaddr [xx:xx:xx:xx:xx:xx]"); return 0; }
functions
int get_memory_display_mode (void) { return swap_bytes; }
functions
void set_memory_display_mode (int mode) { swap_bytes = mode; }
functions
int get_cmd_size (void) { int size = 0; char *sizestr; sizestr = strchr (argvect[0], '.'); if (sizestr == NULL || sizestr[0] == '\0' || sizestr[1] == '\0') { size = DEFAULT_SIZE; }
functions
void display_memory (char *value, int size, int littleEndian) { int x; int start = littleEndian ? size - 1 : 0 ; int end = littleEndian ? -1 : size; int incr = littleEndian ? -1 : 1; if (value) { for (x = start; x != end; x += incr) xprintf ("%02x", value[x] & 0xff); }
functions
int peek (void) { mem_addr_t addr; int size = get_cmd_size (); if (size > 0) { /* We already checked to see if the command was legal when we called the function, so there's no need to worry about that here. */ if (argvect[1] != 0) { char value[8]; str2addr (argvect[1], &addr); if (r...
functions
int poke (void) { int size = 0; size = get_cmd_size (); if (size > 0) { /* We already checked to see if the command was legal when we called the function, so there's no need to worry about that here. */ if ((argvect[1] != 0) && (argvect[2] != 0)) { char value[8]; mem_addr_t addr; s...
functions
int mem_cmd (cmdmode_t mode) { if (mode == USAGE) { usage ("memory[.size] address [value]"); return 0; }
functions
int dump_cmd (cmdmode_t mode) { mem_addr_t addr; char value[8]; if (mode == USAGE) { usage ("dump[.size] location [count]"); return 0; }
functions
int gethexnibble(void) { int ch; inbuf[scnt++] = ch = srec_input_char(); if (ch >= '0' && ch <= '9') return (ch - '0'); if (ch >= 'a' && ch <= 'f') return (ch - 'a' + 10); if (ch >= 'A' && ch <= 'F') return (ch - 'A' + 10); inbuf[scnt] = '\0'; xprintf("Bad hex char: %s\n", inbuf); return -...
functions
int gethexbyte(void) { int nib; unsigned char n; if ((nib = gethexnibble()) < 0) return -1; n = nib << 4; if ((nib = gethexnibble()) < 0) return -1; n |= nib; return n; }
functions
int chk_cksum(unsigned int cksum, int rval) { int n; if ((n = gethexbyte()) < 0) return -1; cksum = ~cksum & 0xff; if (cksum != n) { inbuf[scnt] = '\0'; xprintf("Bad cksum[%02x]: %s\n", cksum, inbuf); return -1; }
functions
int load_srec(srec_input_func_t inp_func) { int count, dcount, data, n, addr_bytes = 0, is_term, is_comment; unsigned int address, cksum; unsigned char data_buf[256]; mem_addr_t memaddr; srec_input_char = inp_func; is_comment = is_term = 0; while (srec_input_char() != 'S') ; scnt = 0; inbuf[sc...
functions
int load_cmd (cmdmode_t mode) { if (mode == USAGE) { usage ("load"); return 0; }
functions
int transfer_cmd (cmdmode_t mode) { if (mode == USAGE) { usage ("$"); return 0; }
functions
void display_group (int which_group) { int len = 0; int skipping_group = 0; char buf[80]; int start_entry = 0; int i; if (which_group >= 0) { start_entry = which_group; }
functions
else if (!skipping_group) { #ifdef REG_VALID_FIELD_IN_REGSTRUCT #else #endif xsprintf(buf, "%4s: %s", regtab[i].registername, get_register_str (regtab[i].registernumber, 0 , REGVALID_VAL)); #undef REGVALID_VAL buflen = strlen (buf); if ((buflen + len + 3) >= 80) { xprintf ("...
functions
else if(len > 0) { xprintf (" "); len += 3; }
functions
int getregister (void) { int i; if (argvect[1] == 0) { display_group (-1); }
functions
int setregister (void) { int number = -1; int i; if ((argvect[1] != 0) && (argvect[2] != 0)) { i = 0; while (regtab[i].registername != NULL) { if (!(strcmp (argvect[1], regtab[i].registername))) { number = regtab[i].registernumber; break; }
functions
int reg_cmd (cmdmode_t mode) { if (mode == USAGE) { usage ("register [register name] [value]"); return 0; }