label
int64
0
1
func
stringlengths
21
96.3k
1
void HELPER(set_cp_reg)(CPUARMState *env, void *rip, uint32_t value){ const ARMCPRegInfo *ri = rip; ri->writefn(env, ri, value);}
0
static int libspeex_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt){ uint8_t *buf = avpkt->data; int buf_size = avpkt->size; LibSpeexContext *s = avctx->priv_data; int16_t *output; int ret, consumed = 0; /* get output buffer */ s->frame.nb_samples = s->frame_size; if ((ret = ff_get_...
1
static void vmport_class_initfn(ObjectClass *klass, void *data){ DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = vmport_realizefn; dc->no_user = 1;}
1
void qemu_file_skip(QEMUFile *f, int size){ if (f->buf_index + size <= f->buf_size) { f->buf_index += size; }}
1
static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, enum PixelFormat srcFormat, enum PixelFormat dstFormat, int srcW, int srcH, int dstW, int dstH, int flags){ uint8_t *src[4] = {0}; uint8_t *dst[4] = {0}; uint8_t *out[4] = {0}; int srcStride[4], dstStride[4]; int i; uint64_t ssdY, ssdU=0, ssdV=0, ssdA=0...
1
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ mp_image_t *dmpi; // hope we'll get DR buffer: dmpi=ff_vf_get_image(vf->next, IMGFMT_YV12, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | ((vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0), mpi->w * vf->priv->scalew, mpi->h / vf->priv->scaleh - vf...
1
static void runstate_init(void){ const RunStateTransition *p; memset(&runstate_valid_transitions, 0, sizeof(runstate_valid_transitions)); for (p = &runstate_transitions_def[0]; p->from != RUN_STATE_MAX; p++) { runstate_valid_transitions[p->from][p->to] = true; }}
0
static void decode_vui(HEVCContext *s, HEVCSPS *sps){ VUI *vui = &sps->vui; GetBitContext *gb = &s->HEVClc->gb; GetBitContext backup; int sar_present, alt = 0; av_log(s->avctx, AV_LOG_DEBUG, "Decoding VUI\n"); sar_present = get_bits1(gb); if (sar_present) { uint8_t sar_idx = get_bits(gb, 8); if (sar_idx < FF_ARRAY_ELEM...
0
void ff_vc1_interp_mc(VC1Context *v){ MpegEncContext *s = &v->s; H264ChromaContext *h264chroma = &v->h264chroma; uint8_t *srcY, *srcU, *srcV; int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; int off, off_uv; int v_edge_pos = s->v_edge_pos >> v->field_mode; int use_ic = v->next_use_ic; if (!v->field_mode && ...
0
static av_cold int msrle_decode_init(AVCodecContext *avctx){ MsrleContext *s = avctx->priv_data; s->avctx = avctx; switch (avctx->bits_per_coded_sample) { case 4: case 8: avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 24: avctx->pix_fmt = AV_PIX_FMT_BGR24; break; default: av_log(avctx, AV_LOG_ERROR, "unsupported bits pe...
0
static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert){ int x = 0, y = 0; while (bytestream2_get_bytes_left(&s->gb) > 0) { int run_length, color; if (y >= s->avctx->height) return 0; color = bytestream2_get_byte(&s->gb); if (color & 0x80) { run_length = 1; }else{ run_length = (color & 0x7f) + 2; color...
0
static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset){ MXFContext *mxf = arg; MXFPartition *partition; UID op; uint64_t footer_partition; uint32_t nb_essence_containers; int err; if (mxf->partitions_count+1 >= UINT_MAX / sizeof(*mxf->partitions)) return AVERROR(E...
0
char *av_base64_encode(uint8_t * src, int len){ static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; char *ret, *dst; unsigned i_bits = 0; int i_shift = 0; int bytes_remaining = len; if (len < UINT_MAX / 4) { ret = dst = av_malloc(len * 4 / 3 + 12); } else return NULL; if (len) ...
0
av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, AVCodecContext *avctx)#elseav_cold void ff_blockdsp_init_x86(BlockDSPContext *c)#endif /* FF_API_XVMC */{#if HAVE_INLINE_ASM int cpu_flags = av_get_cpu_flags(); if (INLINE_MMX(cpu_flags)) { c->clear_block = clear_block_mmx; c->clear_blocks = clear_blocks_mmx; }#if F...
0
static int read_bfraction(VC1Context *v, GetBitContext* gb) { v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index]; return 0;}
1
AVStream *add_video_stream(AVFormatContext *oc, int codec_id){ AVCodec *codec; AVCodecContext *c; AVStream *st; uint8_t *picture_buf; int size; st = av_new_stream(oc, 0); if (!st) { fprintf(stderr, "Could not alloc stream\n"); exit(1); } /* find the mpeg1 video encoder */ codec = avcodec_find_encoder(codec_id); if (!co...
1
const uint8_t *get_submv_prob(uint32_t left, uint32_t top){ if (left == top) return vp8_submv_prob[4 - !!left]; if (!top) return vp8_submv_prob[2]; return vp8_submv_prob[1 - !!left];}
1
static inline void cpu_handle_interrupt(CPUState *cpu, TranslationBlock **last_tb){ CPUClass *cc = CPU_GET_CLASS(cpu); int interrupt_request = cpu->interrupt_request; if (unlikely(interrupt_request)) { if (unlikely(cpu->singlestep_enabled & SSTEP_NOIRQ)) { /* Mask out external interrupts for this step. */ interrupt_req...
1
int qemu_get_byte(QEMUFile *f){ int result; result = qemu_peek_byte(f, 0); qemu_file_skip(f, 1); return result;}
1
bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr){ TranslationBlock *tb; bool r = false; tb_lock(); tb = tb_find_pc(retaddr); if (tb) { cpu_restore_state_from_tb(cpu, tb, retaddr); if (tb->cflags & CF_NOCACHE) { /* one-shot translation, invalidate it immediately */ tb_phys_invalidate(tb, -1); tb_free(tb); r = tr...
1
pflash_t *pflash_cfi01_register(target_phys_addr_t base, DeviceState *qdev, const char *name, target_phys_addr_t size, BlockDriverState *bs, uint32_t sector_len, int nb_blocs, int width, uint16_t id0, uint16_t id1, uint16_t id2, uint16_t id3, int be){ pflash_t *pfl; target_phys_addr_t total_len; int ret; total_len = se...
1
static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr, UHCI_TD *td, uint32_t td_addr, uint32_t *int_mask){ int len = 0, max_len; bool spd; bool queuing = (q != NULL); uint8_t pid = td->token & 0xff; UHCIAsync *async = uhci_async_find_td(s, td_addr); if (async) { if (uhci_queue_verify(async->queue, qh_a...
1
static int writev_f(BlockBackend *blk, int argc, char **argv){ struct timeval t1, t2; bool Cflag = false, qflag = false; int flags = 0; int c, cnt; char *buf; int64_t offset; /* Some compilers get confused and warn if this is not initialized. */ int total = 0; int nr_iov; int pattern = 0xcd; QEMUIOVector qiov; while ((...
1
libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample){ libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset); enum dshowDeviceType devtype = pin->filter->type; void *priv_data; uint8_t *buf; int buf_size; int index; int64_t curtime; dshowdebug("libAVMemInputPin_Receive(%p)\n", this); if (!sample...
1
static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, const uint8_t *data, int size){ VP9Context *s = avctx->priv_data; int ret, tile_row, tile_col, i, ref = -1, row, col; ptrdiff_t yoff = 0, uvoff = 0; ret = decode_frame_header(avctx, data, size, &ref); if (ret < 0) { return ret; } else if...
1
static int parallels_open(BlockDriverState *bs, int flags){ BDRVParallelsState *s = bs->opaque; int i; struct parallels_header ph; bs->read_only = 1; // no write support yet if (bdrv_pread(bs->file, 0, &ph, sizeof(ph)) != sizeof(ph)) goto fail; if (memcmp(ph.magic, HEADER_MAGIC, 16) ||(le32_to_cpu(ph.version) != HEADER...
1
int inet_aton (const char * str, struct in_addr * add){ const char * pch = str; unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0; add1 = atoi(pch); pch = strpbrk(pch,"."); if (pch == 0 || ++pch == 0) goto done; add2 = atoi(pch); pch = strpbrk(pch,"."); if (pch == 0 || ++pch == 0) goto done; add3 = atoi(pch); pch = s...
1
static void pci_indirect(void){ QVirtioPCIDevice *dev; QPCIBus *bus; QVirtQueuePCI *vqpci; QGuestAllocator *alloc; QVirtioBlkReq req; QVRingIndirectDesc *indirect; void *addr; uint64_t req_addr; uint64_t capacity; uint32_t features; uint32_t free_head; uint8_t status; char *data; bus = test_start(); dev = virtio_blk_in...
1
static void qvirtio_scsi_pci_free(QVirtIOSCSI *vs){ int i; for (i = 0; i < vs->num_queues + 2; i++) { qvirtqueue_cleanup(vs->dev->bus, vs->vq[i], vs->qs->alloc); } qvirtio_pci_device_disable(container_of(vs->dev, QVirtioPCIDevice, vdev)); g_free(vs->dev); qvirtio_scsi_stop(vs->qs); g_free(vs);}
1
static void *circular_buffer_task_tx( void *_URLContext){ URLContext *h = _URLContext; UDPContext *s = h->priv_data; int old_cancelstate; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelstate); for(;;) { int len; uint8_t tmp[4]; pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_cancelstate); av_usleep(s->pac...
1
int ff_lpc_calc_coefs(LPCContext *s, const int32_t *samples, int blocksize, int min_order, int max_order, int precision, int32_t coefs[][MAX_LPC_ORDER], int *shift, enum FFLPCType lpc_type, int lpc_passes, int omethod, int max_shift, int zero_shift){ double autoc[MAX_LPC_ORDER+1]; double ref[MAX_LPC_ORDER]; double lpc[...
1
static void string_deserialize(void **native_out, void *datap, VisitorFunc visit, Error **errp){ StringSerializeData *d = datap; d->siv = string_input_visitor_new(string_output_get_string(d->sov)); visit(string_input_get_visitor(d->siv), native_out, errp);}
1
static int rtp_read_header(AVFormatContext *s){ uint8_t recvbuf[RTP_MAX_PACKET_LENGTH]; char host[500], sdp[500]; int ret, port; URLContext* in = NULL; int payload_type; AVCodecContext codec = { 0 }; struct sockaddr_storage addr; AVIOContext pb; socklen_t addrlen = sizeof(addr); RTSPState *rt = s->priv_data; if (!ff_ne...
1
static void qemu_aio_wait_all(void){ while (aio_poll(ctx, true)) { /* Do nothing */ }}
1
static int send_invoke_response(URLContext *s, RTMPPacket *pkt){ RTMPContext *rt = s->priv_data; double seqnum; char filename[64]; char command[64]; int stringlen; char *pchar; const uint8_t *p = pkt->data; uint8_t *pp = NULL; RTMPPacket spkt = { 0 }; GetByteContext gbc; int ret; bytestream2_init(&gbc, p, pkt->size); i...
1
static void coroutine_fn v9fs_open(void *opaque){ int flags; int32_t fid; int32_t mode; V9fsQID qid; int iounit = 0; ssize_t err = 0; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; if (s->proto_version == V9FS_PROTO_2000L) { err = pdu_unmarshal(pdu, offset, "dd",...
1
static void init_blk_migration_it(void *opaque, BlockDriverState *bs){ BlkMigDevState *bmds; int64_t sectors; if (!bdrv_is_read_only(bs)) { sectors = bdrv_nb_sectors(bs); if (sectors <= 0) { return; } bmds = g_malloc0(sizeof(BlkMigDevState)); bmds->bs = bs; bmds->bulk_completed = 0; bmds->total_sectors = sectors; bmds-...
1
static void megasas_command_complete(SCSIRequest *req, uint32_t status, size_t resid){ MegasasCmd *cmd = req->hba_private; uint8_t cmd_status = MFI_STAT_OK; trace_megasas_command_complete(cmd->index, status, resid); if (req->io_canceled) { return; } if (cmd->req == NULL) { /* * Internal command complete */ cmd_status =...
1
static void GLZWDecodeInit(GifState * s, int csize){ /* read buffer */ s->eob_reached = 0; s->pbuf = s->buf; s->ebuf = s->buf; s->bbuf = 0; s->bbits = 0; /* decoder */ s->codesize = csize; s->cursize = s->codesize + 1; s->curmask = mask[s->cursize]; s->top_slot = 1 << s->cursize; s->clear_code = 1 << s->codesize; s->en...
1
SchroFrame *ff_create_schro_frame(AVCodecContext *avctx, SchroFrameFormat schro_frame_fmt){ AVFrame *p_pic; SchroFrame *p_frame; int y_width, uv_width; int y_height, uv_height; int i; y_width = avctx->width; y_height = avctx->height; uv_width = y_width >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt)); uv_height = y_hei...
1
static int applehttp_open(URLContext *h, const char *uri, int flags){ AppleHTTPContext *s; int ret, i; const char *nested_url; if (flags & AVIO_FLAG_WRITE) return AVERROR(ENOSYS); s = av_mallocz(sizeof(AppleHTTPContext)); if (!s) return AVERROR(ENOMEM); h->priv_data = s; h->is_streamed = 1; if (av_strstart(uri, "appleh...
1
static int mpeg_decode_slice(AVCodecContext *avctx, AVPicture *pict, int start_code, UINT8 *buf, int buf_size){ Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; int ret; start_code = (start_code - 1) & 0xff; if (start_code >= s->mb_height) return -1; s->last_dc[0] = 1 << (7 + s->intra_dc_prec...
1
static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket * pkt, uint32_t * timestamp, const uint8_t * buf, int len, int flags){ uint8_t nal = buf[0]; uint8_t type = (nal & 0x1f); int result= 0; uint8_t start_sequence[]= {0, 0, 1};#ifdef DEBUG assert(data); assert(data->cookie == ...
1
static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc, const int16_t *chrSrc, const int16_t *alpSrc, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, int dstW, int chrDstW){ int i;#if COMPILE_TEMPLATE_MMX if(!(c->flags & SWS_BITEXACT)) { long p= 4; const uint8_t *src[4]= {alpSrc + dstW,...
1
static int interp(RA144Context *ractx, int16_t *out, int a, int copyold, int energy){ int work[10]; int b = NBLOCKS - a; int i; // Interpolate block coefficients from the this frame's forth block and // last frame's forth block. for (i=0; i<30; i++) out[i] = (a * ractx->lpc_coef[0][i] + b * ractx->lpc_coef[1][i])>> 2; ...
1
static int dv_extract_audio(uint8_t *frame, uint8_t *ppcm[4], const DVprofile *sys){ int size, chan, i, j, d, of, smpls, freq, quant, half_ch; uint16_t lc, rc; const uint8_t *as_pack; uint8_t *pcm, ipcm; as_pack = dv_extract_pack(frame, dv_audio_source); if (!as_pack) /* No audio ? */ return 0; smpls = as_pack[1] & 0x3...
1
void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size){ if (min_size < *size) return ptr; min_size = FFMAX(17 * min_size / 16 + 32, min_size); ptr = av_realloc(ptr, min_size); /* we could set this to the unmodified min_size but this is safer * if the user lost the ptr and uses NULL now */ if (!ptr) min_s...
1
static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block, int index, const int type){ static const uint8_t *const scan_patterns[4] = { luma_dc_zigzag_scan, zigzag_scan, svq3_scan, chroma_dc_scan }; int run, level, sign, vlc, limit; const int intra = 3 * type >> 2; const uint8_t *const scan = scan_patterns[...
0
static int flac_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size){ FLACContext *s = avctx->priv_data; int metadata_last, metadata_type, metadata_size; int tmp = 0, i, j = 0, input_buf_size; int16_t *samples = data, *left, *right; *data_size = 0; s->avctx = avctx; if(s->max_fram...
0
int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name){ switch(nb_channels) { case 1: return AV_CH_LAYOUT_MONO; case 2: return AV_CH_LAYOUT_STEREO; case 3: return AV_CH_LAYOUT_SURROUND; case 4: return AV_CH_LAYOUT_QUAD; case 5: return AV_CH_LAYOUT_5POINT0; case 6: return AV_C...
0
static inline void downmix_2f_1r_to_dolby(float *samples){ int i; for (i = 0; i < 256; i++) { samples[i] -= samples[i + 512]; samples[i + 256] += samples[i + 512]; samples[i + 512] = 0; }}
0
static int vc1_init_common(VC1Context *v){ static int done = 0; int i = 0; static VLC_TYPE vlc_table[32372][2]; v->hrd_rate = v->hrd_buffer = NULL; /* VLC tables */ if (!done) { INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23, ff_vc1_bfraction_bits, 1, 1, ff_vc1_bfraction_codes, 1, 1, 1 << VC1_BFRACTI...
0
static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, int *golden_frame){ VP56RangeCoder *c = &s->c; int parse_filter_info = 0; int coeff_offset = 0; int vrt_shift = 0; int sub_version; int rows, cols; int res = 1; int separated_coeff = buf[0] & 1; s->framep[VP56_FRAME_CURRENT]->key_frame = !(bu...
0
int ff_network_wait_fd_timeout(int fd, int write, int64_t timeout, AVIOInterruptCB *int_cb){ int ret; int64_t wait_start = 0; while (1) { ret = ff_network_wait_fd(fd, write); if (ret != AVERROR(EAGAIN)) return ret; if (ff_check_interrupt(int_cb)) return AVERROR_EXIT; if (timeout > 0) { if (!wait_start) wait_start = av_...
1
GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp){ GuestNetworkInterfaceList *head = NULL, *cur_item = NULL; struct ifaddrs *ifap, *ifa; if (getifaddrs(&ifap) < 0) { error_setg_errno(errp, errno, "getifaddrs failed"); goto error; } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { GuestNetworkInterfa...
1
PPC_OP(mulli){ T0 = (Ts0 * SPARAM(1)); RETURN();}
1
static int print_uint64(DeviceState *dev, Property *prop, char *dest, size_t len){ uint64_t *ptr = qdev_get_prop_ptr(dev, prop); return snprintf(dest, len, "%" PRIu64, *ptr);}
1
static av_always_inline void decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7){ VP8Context *s = avctx->priv_data; VP8ThreadData *prev_td, *next_td, *td = &s->thread_data[threadnr]; int mb_y = td->thread_mb_pos >> 16; int mb_x, mb_xy = mb_y * s->mb_width; int num_jobs = s->...
1
static void yop_next_macroblock(YopDecContext *s){ // If we are advancing to the next row of macroblocks if (s->row_pos == s->frame.linesize[0] - 2) { s->dstptr += s->frame.linesize[0]; s->row_pos = 0; }else { s->row_pos += 2; } s->dstptr += 2;}
1
static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist){ AHCICmdHdr *cmd = ad->cur_cmd; uint32_t opts = le32_to_cpu(cmd->opts); uint64_t prdt_addr = le64_to_cpu(cmd->tbl_addr) + 0x80; int sglist_alloc_hint = opts >> AHCI_CMD_HDR_PRDT_LEN; dma_addr_t prdt_len = (sglist_alloc_hint * sizeof(AHCI_SG)); dma_addr...
1
static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb){ MpegEncContext *s = &ctx->m; int width, height, vo_ver_id; /* vol header */ skip_bits(gb, 1); /* random access */ s->vo_type = get_bits(gb, 8); if (get_bits1(gb) != 0) { /* is_ol_id */ vo_ver_id = get_bits(gb, 4); /* vo_ver_id */ skip_bits(gb, 3); /...
1
static int ac3_probe(AVProbeData *p){ int max_frames, first_frames, frames; uint8_t *buf, *buf2, *end; AC3HeaderInfo hdr; if(p->buf_size < 7) return 0; max_frames = 0; buf = p->buf; end = buf + FFMIN(4096, p->buf_size - 7); for(; buf < end; buf++) { buf2 = buf; for(frames = 0; buf2 < end; frames++) { if(ff_ac3_parse_he...
1
static void virtio_ccw_device_plugged(DeviceState *d){ VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); SubchDev *sch = dev->sch; sch->id.cu_model = virtio_bus_get_vdev_id(&dev->bus); css_generate_sch_crws(sch->cssid, sch->ssid, sch->schid, d->hotplugged, 1);}
1
static void digic_uart_write(void *opaque, hwaddr addr, uint64_t value, unsigned size){ DigicUartState *s = opaque; unsigned char ch = value; addr >>= 2; switch (addr) { case R_TX: if (s->chr) { qemu_chr_fe_write_all(s->chr, &ch, 1); } break; case R_ST: /* * Ignore write to R_ST. * * The point is that this register is ...
1
static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, vorbis_residue *vr, uint_fast8_t ch, uint_fast8_t *do_not_decode, float *vec, uint_fast16_t vlen, int vr_type){ GetBitContext *gb = &vc->gb; uint_fast8_t c_p_c = vc->codebooks[vr->classbook].dimensions; uint_fast16_t ptns_to_read = vr->ptns_...
1
static int local_name_to_path(FsContext *ctx, V9fsPath *dir_path, const char *name, V9fsPath *target){ if (dir_path) { v9fs_path_sprintf(target, "%s/%s", dir_path->data, name); } else { v9fs_path_sprintf(target, "%s", name); } return 0;}
0
static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused){ int i; for (i=0; i<width; i++) { int b= src1[6*i + 0] + src1[6*i + 3]; int g= src1[6*i + 1] + src1[6*i + 4]; int r= src1[6*i + 2] + src1[6*i + 5]; dstU[i]= (RU*r + GU*g + BU*b...
0
static int ftp_parse_entry_mlsd(char *mlsd, AVIODirEntry *next){ char *fact, *value; av_dlog(NULL, "%s\n", mlsd); while(fact = av_strtok(mlsd, ";", &mlsd)) { if (fact[0] == ' ') { next->name = av_strdup(&fact[1]); continue; } fact = av_strtok(fact, "=", &value); if (!av_strcasecmp(fact, "type")) { if (!av_strcasecmp(va...
0
static int get_scale_idx(GetBitContext *gb, int ref){ int t = get_vlc2(gb, dscf_vlc.table, MPC7_DSCF_BITS, 1) - 7; if (t == 8) return get_bits(gb, 6); return ref + t;}
0
int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, struct image_info * info){ struct elfhdr elf_ex; struct elfhdr interp_elf_ex; struct exec interp_ex; int interpreter_fd = -1; /* avoid warning */ abi_ulong load_addr, load_bias; int load_addr_set = 0; unsigned int interpreter_type = INTERPRET...
0
static sd_rsp_type_t sd_app_command(SDState *sd, SDRequest req){ DPRINTF("ACMD%d 0x%08x\n", req.cmd, req.arg); sd->card_status |= APP_CMD; switch (req.cmd) { case 6:/* ACMD6: SET_BUS_WIDTH */ switch (sd->state) { case sd_transfer_state: sd->sd_status[0] &= 0x3f; sd->sd_status[0] |= (req.arg & 0x03) << 6; return sd_r1; ...
0
static void bt_dummy_lmp_connection_complete(struct bt_link_s *link){ if (link->slave->reject_reason) fprintf(stderr, "%s: stray LMP_not_accepted received, fixme\n", __func__); else fprintf(stderr, "%s: stray LMP_accepted received, fixme\n", __func__); exit(-1);}
0
static void add_flagname_to_bitmaps(const char *flagname, uint32_t *features, uint32_t *ext_features, uint32_t *ext2_features, uint32_t *ext3_features){ int i; int found = 0; for ( i = 0 ; i < 32 ; i++ ) if (feature_name[i] && !strcmp (flagname, feature_name[i])) { *features |= 1 << i; found = 1; } for ( i = 0 ; i < 32...
0
struct pxa2xx_i2c_s *pxa2xx_i2c_init(target_phys_addr_t base, qemu_irq irq, int ioregister){ int iomemtype; struct pxa2xx_i2c_s *s = (struct pxa2xx_i2c_s *) i2c_slave_init(i2c_init_bus(), 0, sizeof(struct pxa2xx_i2c_s)); s->base = base; s->irq = irq; s->slave.event = pxa2xx_i2c_event; s->slave.recv = pxa2xx_i2c_rx; s->...
0
static int v9fs_synth_link(FsContext *fs_ctx, V9fsPath *oldpath, V9fsPath *newpath, const char *buf){ errno = EPERM; return -1;}
0
static bool pmsav7_rgnr_vmstate_validate(void *opaque, int version_id){ ARMCPU *cpu = opaque; return cpu->env.pmsav7.rnr < cpu->pmsav7_dregion;}
0
int net_init_dump(const NetClientOptions *opts, const char *name, NetClientState *peer, Error **errp){ int len, rc; const char *file; char def_file[128]; const NetdevDumpOptions *dump; NetClientState *nc; DumpNetClient *dnc; assert(opts->type == NET_CLIENT_OPTIONS_KIND_DUMP); dump = opts->u.dump; assert(peer); if (dump...
0
static int handle_secondary_tcp_pkt(NetFilterState *nf, Connection *conn, Packet *pkt){ struct tcphdr *tcp_pkt; tcp_pkt = (struct tcphdr *)pkt->transport_header; if (trace_event_get_state(TRACE_COLO_FILTER_REWRITER_DEBUG)) { trace_colo_filter_rewriter_pkt_info(__func__, inet_ntoa(pkt->ip->ip_src), inet_ntoa(pkt->ip->ip...
0
static void nvdimm_dsm_reserved_root(AcpiNVDIMMState *state, NvdimmDsmIn *in, hwaddr dsm_mem_addr){ switch (in->function) { case 0x0: nvdimm_dsm_function0(0x1 | 1 << 1 /* Read FIT */, dsm_mem_addr); return; case 0x1 /* Read FIT */: nvdimm_dsm_func_read_fit(state, in, dsm_mem_addr); return; } nvdimm_dsm_no_payload(NVDIM...
0
static void omap_prcm_dpll_update(struct omap_prcm_s *s){ omap_clk dpll = omap_findclk(s->mpu, "dpll"); omap_clk dpll_x2 = omap_findclk(s->mpu, "dpll"); omap_clk core = omap_findclk(s->mpu, "core_clk"); int mode = (s->clken[9] >> 0) & 3; int mult, div; mult = (s->clksel[5] >> 12) & 0x3ff; div = (s->clksel[5] >> 8) & 0x...
0
void HELPER(dc_zva)(CPUARMState *env, uint64_t vaddr_in){ /* Implement DC ZVA, which zeroes a fixed-length block of memory. * Note that we do not implement the (architecturally mandated) * alignment fault for attempts to use this on Device memory * (which matches the usual QEMU behaviour of not implementing either * al...
0
static void slirp_bootp_load(QEMUFile *f, Slirp *slirp){ int i; for (i = 0; i < NB_BOOTP_CLIENTS; i++) { slirp->bootp_clients[i].allocated = qemu_get_be16(f); qemu_get_buffer(f, slirp->bootp_clients[i].macaddr, 6); }}
0
static int scsi_handle_rw_error(SCSIDiskReq *r, int error){ bool is_read = (r->req.cmd.xfer == SCSI_XFER_FROM_DEV); SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); BlockErrorAction action = bdrv_get_error_action(s->qdev.conf.bs, is_read, error); if (action == BLOCK_ERROR_ACTION_REPORT) { switch (error) {...
0
void migrate_fd_connect(MigrationState *s){ s->state = MIG_STATE_ACTIVE; trace_migrate_set_state(MIG_STATE_ACTIVE); s->bytes_xfer = 0; /* This is a best 1st approximation. ns to ms */ s->expected_downtime = max_downtime/1000000; s->cleanup_bh = qemu_bh_new(migrate_fd_cleanup, s); s->file = qemu_fopen_ops(s, &migration_...
0
void *iommu_dma_memory_map(DMAContext *dma, dma_addr_t addr, dma_addr_t *len, DMADirection dir){ int err; target_phys_addr_t paddr, plen; void *buf; if (dma->map) { return dma->map(dma, addr, len, dir); } plen = *len; err = dma->translate(dma, addr, &paddr, &plen, dir); if (err) { return NULL; } /* * If this is true, t...
0
static void lx_init(const LxBoardDesc *board, MachineState *machine){#ifdef TARGET_WORDS_BIGENDIAN int be = 1;#else int be = 0;#endif MemoryRegion *system_memory = get_system_memory(); XtensaCPU *cpu = NULL; CPUXtensaState *env = NULL; MemoryRegion *ram, *rom, *system_io; DriveInfo *dinfo; pflash_t *flash = NULL; QemuO...
0
void kvm_arch_reset_vcpu(X86CPU *cpu){ CPUX86State *env = &cpu->env; env->exception_injected = -1; env->interrupt_injected = -1; env->xcr0 = 1; if (kvm_irqchip_in_kernel()) { env->mp_state = cpu_is_bsp(cpu) ? KVM_MP_STATE_RUNNABLE : KVM_MP_STATE_UNINITIALIZED; } else { env->mp_state = KVM_MP_STATE_RUNNABLE; } if (cpu->...
1
static int speex_header(AVFormatContext *s, int idx) { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; struct speex_params *spxp = os->private; AVStream *st = s->streams[idx]; uint8_t *p = os->buf + os->pstart; if (!spxp) { spxp = av_mallocz(sizeof(*spxp)); os->private = spxp; } if (spxp->se...
1
static ExitStatus trans_fop_wed_0e(DisasContext *ctx, uint32_t insn, const DisasInsn *di){ unsigned rt = assemble_rt64(insn); unsigned ra = extract32(insn, 21, 5); return do_fop_wed(ctx, rt, ra, di->f_wed);}
1
void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f){ int interior_limit, filter_level; if (s->segmentation.enabled) { filter_level = s->segmentation.filter_level[mb->segment]; if (!s->segmentation.absolute_vals) filter_level += s->filter.level; } else filter_level = s->filter.level; if (s->...
1
void muls64(int64_t *phigh, int64_t *plow, int64_t a, int64_t b){#if defined(__x86_64__) __asm__ ("imul %0\n\t" : "=d" (*phigh), "=a" (*plow) : "a" (a), "0" (b) );#else int64_t ph; uint64_t pm1, pm2, pl; pl = (uint64_t)((uint32_t)a) * (uint64_t)((uint32_t)b); pm1 = (a >> 32) * (uint32_t)b; pm2 = (uint32_t)a * (b >> 32)...
1
static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf){ SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req); SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev); uint64_t nb_sectors; uint8_t *outbuf; int buflen; switch (req->cmd.buf[0]) { case INQUIRY: case MODE_SENSE: case MODE_SENSE_10: case R...
1
static int decode_syncpoint(NUTContext *nut){ AVFormatContext *s= nut->avf; ByteIOContext *bc = &s->pb; int64_t end; uint64_t tmp; int i; AVRational time_base; nut->last_syncpoint_pos= url_ftell(bc)-8; end= get_packetheader(nut, bc, 1); end += url_ftell(bc) - 4; tmp= get_v(bc); get_v(bc); //back_ptr_div16 time_base= nu...
1
static void mips_jazz_init(MachineState *machine, enum jazz_model_e jazz_model){ MemoryRegion *address_space = get_system_memory(); const char *cpu_model = machine->cpu_model; char *filename; int bios_size, n; MIPSCPU *cpu; CPUClass *cc; CPUMIPSState *env; qemu_irq *i8259; rc4030_dma *dmas; MemoryRegion *rc4030_dma_mr;...
1
static void free_texture(void *opaque, uint8_t *data){ ID3D11Texture2D_Release((ID3D11Texture2D *)opaque);}
1
static int alac_decode_frame(AVCodecContext *avctx, void *outbuffer, int *outputsize, const uint8_t *inbuffer, int input_buffer_size){ ALACContext *alac = avctx->priv_data; int channels; unsigned int outputsamples; int hassize; int readsamplesize; int wasted_bytes; int isnotcompressed; uint8_t interlacing_shift; uint8_...
1
int bdrv_truncate(BlockDriverState *bs, int64_t offset){ BlockDriver *drv = bs->drv; int ret; if (!drv) return -ENOMEDIUM; if (!drv->bdrv_truncate) return -ENOTSUP; if (bs->read_only) return -EACCES; ret = drv->bdrv_truncate(bs, offset); if (ret == 0) { ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS); bdrv_...
1
static void gen_sub(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb){ TCGv res = tcg_temp_new(); TCGv sr_cy = tcg_temp_new(); TCGv sr_ov = tcg_temp_new(); tcg_gen_sub_tl(res, srca, srcb); tcg_gen_xor_tl(sr_cy, srca, srcb); tcg_gen_xor_tl(sr_ov, res, srcb); tcg_gen_and_tl(sr_ov, sr_ov, sr_cy); tcg_gen_setcond_tl(TCG_C...
1
static void ecc_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val){ ECCState *s = opaque; switch (addr & ECC_ADDR_MASK) { case ECC_MER: s->regs[0] = (s->regs[0] & (ECC_MER_VER | ECC_MER_IMPL)) | (val & ~(ECC_MER_VER | ECC_MER_IMPL)); DPRINTF("Write memory enable %08x\n", val); break; case ECC_MDR: s->regs[...
1
static void idct32(int *out, int *tab, int sblimit, int left_shift){ int i, j; int *t, *t1, xr; const int *xp = costab32; for(j=31;j>=3;j-=2) tab[j] += tab[j - 2]; t = tab + 30; t1 = tab + 2; do { t[0] += t[-4]; t[1] += t[1 - 4]; t -= 4; } while (t != t1); t = tab + 28; t1 = tab + 4; do { t[0] += t[-8]; t[1] += t[1-8];...