label
int64
0
1
func
stringlengths
21
96.3k
1
iscsi_co_generic_cb(struct iscsi_context *iscsi, int status, void *command_data, void *opaque){ struct IscsiTask *iTask = opaque; struct scsi_task *task = command_data; iTask->status = status; iTask->do_retry = 0; iTask->task = task; if (status != SCSI_STATUS_GOOD) { if (iTask->retries++ < ISCSI_CMD_RETRIES) { if (stat...
1
int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt){ AVFrame frame = {0}; int ret, got_frame = 0; if (avctx->get_buffer != avcodec_default_get_buffer) { av_log(avctx, AV_LOG_ERROR, "Custom get_buffer() for use with" "avcodec_decode_audio3() detect...
1
static int ape_read_header(AVFormatContext * s){ AVIOContext *pb = s->pb; APEContext *ape = s->priv_data; AVStream *st; uint32_t tag; int i; int total_blocks, final_size = 0; int64_t pts, file_size; /* Skip any leading junk such as id3v2 tags */ ape->junklength = avio_tell(pb); tag = avio_rl32(pb); if (tag != MKTAG('M'...
1
int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, int level){ VDPAUHWContext *hwctx = avctx->hwaccel_context; VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data; VdpVideoSurfaceQueryCapabilities *surface_query_caps; VdpDecoderQueryCapabilities *decoder_query_caps; VdpDecoderCreate *create...
1
static int idcin_probe(AVProbeData *p){ unsigned int number, sample_rate; /* * This is what you could call a "probabilistic" file check: id CIN * files don't have a definite file signature. In lieu of such a marker, * perform sanity checks on the 5 32-bit header fields: * width, height: greater than 0, less than or equ...
0
static inline int hpel_motion(MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, op_pixels_func *pix_op, int motion_x, int motion_y){ int dxy = 0; int emu = 0; src_x += motion_x >> 1; src_y += motion_y >> 1; /* WARNING: do no forget half pels */ src_x = av_clip(src_x, -16, s->width); // FIXME unneede...
0
static inline void downmix_dualmono_to_mono(float *samples){ int i; for (i = 0; i < 256; i++) { samples[i] += samples[i + 256]; samples[i + 256] = 0; }}
1
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit){ const char *driver; DeviceState *dev; driver = bdrv_is_sg(dinfo->bdrv) ? "scsi-generic" : "scsi-disk"; dev = qdev_create(&bus->qbus, driver); qdev_prop_set_uint32(dev, "scsi-id", unit); qdev_prop_set_drive(dev, "drive", dinfo); qdev_init(d...
1
static int film_read_close(AVFormatContext *s){ FilmDemuxContext *film = s->priv_data; av_free(film->sample_table); av_free(film->stereo_buffer); return 0;}
1
static av_cold int libschroedinger_decode_init(AVCodecContext *avctx){ SchroDecoderParams *p_schro_params = avctx->priv_data; /* First of all, initialize our supporting libraries. */ schro_init(); schro_debug_set_level(avctx->debug); p_schro_params->decoder = schro_decoder_new(); schro_decoder_set_skip_ratio(p_schro_pa...
1
static void update_stream_timings(AVFormatContext *ic){ int64_t start_time, start_time1, start_time_text, end_time, end_time1; int64_t duration, duration1, filesize; int i; AVStream *st; AVProgram *p; start_time = INT64_MAX; start_time_text = INT64_MAX; end_time = INT64_MIN; duration = INT64_MIN; for(i = 0;i < ic->nb_s...
1
static int sd_open(BlockDriverState *bs, QDict *options, int flags, Error **errp){ int ret, fd; uint32_t vid = 0; BDRVSheepdogState *s = bs->opaque; char vdi[SD_MAX_VDI_LEN], tag[SD_MAX_VDI_TAG_LEN]; uint32_t snapid; char *buf = NULL; QemuOpts *opts; Error *local_err = NULL; const char *filename; s->bs = bs; s->aio_con...
1
static void pixel_format_message (VncState *vs) { char pad[3] = { 0, 0, 0 }; vnc_write_u8(vs, vs->depth * 8); /* bits-per-pixel */ if (vs->depth == 4) vnc_write_u8(vs, 24); /* depth */ else vnc_write_u8(vs, vs->depth * 8); /* depth */#ifdef WORDS_BIGENDIAN vnc_write_u8(vs, 1); /* big-endian-flag */#else vnc_write_u8(vs...
1
static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size){ VP56RangeCoder *c = &s->c; int header_size, hscale, vscale, i, j, k, l, m, ret; int width = s->avctx->width; int height = s->avctx->height; s->keyframe = !(buf[0] & 1); s->profile = (buf[0]>>1) & 7; s->invisible = !(buf[0] & 0x10); header_...
1
static int load_refcount_block(BlockDriverState *bs, int64_t refcount_block_offset){ BDRVQcowState *s = bs->opaque; int ret; if (cache_refcount_updates) { ret = write_refcount_block(bs); if (ret < 0) { return ret; } } BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_LOAD); ret = bdrv_pread(bs->file, refcount_block_offset, s->ref...
1
void qemu_coroutine_enter(Coroutine *co, void *opaque){ Coroutine *self = qemu_coroutine_self(); CoroutineAction ret; trace_qemu_coroutine_enter(self, co, opaque); if (co->caller) { fprintf(stderr, "Co-routine re-entered recursively\n"); abort(); } co->caller = self; co->entry_arg = opaque; ret = qemu_coroutine_switch(...
1
static int imc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt){ AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int ret, i; IMCContext *q = avctx->priv_data; LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]); if (buf_size < IMC_BLOCK_SIZE *...
1
int init_vlc(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size){ vlc->bits = nb_bits; vlc->table = NULL; vlc->table_allocated = 0; vlc->table_size = 0;#ifdef DEBUG_VLC printf("build table nb_codes=%d\n", nb_codes);#endif if (build_tabl...
1
static void filter(AVFilterContext *ctx){ IDETContext *idet = ctx->priv; int y, i; int64_t alpha[2]={0}; int64_t delta=0; Type type, best_type; int match = 0; for (i = 0; i < idet->csp->nb_components; i++) { int w = idet->cur->video->w; int h = idet->cur->video->h; int refs = idet->cur->linesize[i]; if (i && i<3) { w >...
1
static void div64(uint64_t *plow, uint64_t *phigh, uint64_t b){ uint64_t q, r, a1, a0; int i, qb; a0 = *plow; a1 = *phigh; if (a1 == 0) { q = a0 / b; r = a0 % b; *plow = q; *phigh = r; } else { /* XXX: use a better algorithm */ for(i = 0; i < 64; i++) { a1 = (a1 << 1) | (a0 >> 63); if (a1 >= b) { a1 -= b; qb = 1; } els...
1
static float get_band_cost_UPAIR12_mips(struct AACEncContext *s, PutBitContext *pb, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits){ const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512]; const float IQ = f...
1
static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *frame, opj_image_t *image){ int compno; int x; int y; int width; int height; int *image_line; int frame_index; const int numcomps = image->numcomps; uint16_t *frame_ptr; for (compno = 0; compno < numcomps; ++compno) { if (image->comps[compno]....
1
inline static void RENAME(hcscale)(uint16_t *dst, int dstWidth, uint8_t *src1, uint8_t *src2, int srcW, int xInc, int flags, int canMMX2BeUsed, int16_t *hChrFilter, int16_t *hChrFilterPos, int hChrFilterSize, void *funnyUVCode, int srcFormat, uint8_t *formatConvBuffer, int16_t *mmx2Filter, int32_t *mmx2FilterPos){ if(s...
1
static int tak_read_header(AVFormatContext *s){ TAKDemuxContext *tc = s->priv_data; AVIOContext *pb = s->pb; GetBitContext gb; AVStream *st; uint8_t *buffer = NULL; int ret; st = avformat_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = AV_CODEC_ID_TAK...
1
static void cpu_pre_save(void *opaque){ CPUState *env = opaque; int i; cpu_synchronize_state(env); /* FPU */ env->fpus_vmstate = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; env->fptag_vmstate = 0; for(i = 0; i < 8; i++) { env->fptag_vmstate |= ((!env->fptags[i]) << i); }#ifdef USE_X86LDOUBLE env->fpregs_format_vm...
1
static uint64_t ich_elrsr_read(CPUARMState *env, const ARMCPRegInfo *ri){ GICv3CPUState *cs = icc_cs_from_env(env); uint64_t value = 0; int i; for (i = 0; i < cs->num_list_regs; i++) { uint64_t lr = cs->ich_lr_el2[i]; if ((lr & ICH_LR_EL2_STATE_MASK) == 0 && ((lr & ICH_LR_EL2_HW) == 1 || (lr & ICH_LR_EL2_EOI) == 0)) { ...
1
static int mp_user_removexattr(FsContext *ctx, const char *path, const char *name){ char *buffer; int ret; if (strncmp(name, "user.virtfs.", 12) == 0) { /* * Don't allow fetch of user.virtfs namesapce * in case of mapped security */ errno = EACCES; return -1; } buffer = rpath(ctx, path); ret = lremovexattr(buffer, name...
0
static int decode_subframe_fixed(FLACContext *s, int channel, int pred_order){ int i; av_log(s->avctx, AV_LOG_DEBUG, " SUBFRAME FIXED\n"); /* warm up samples */ av_log(s->avctx, AV_LOG_DEBUG, " warm up samples: %d\n", pred_order); for (i = 0; i < pred_order; i++) { s->decoded[channel][i] = get_sbits(&s->gb, s->curr_bps...
0
static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr){ AACEncContext *s = avctx->priv_data; float **samples = s->planar_samples, *samples2, *la, *overlap; ChannelElement *cpe; SingleChannelElement *sce; IndividualChannelStream *ics; int i, its, ch, w, chans, tag,...
1
void virtio_config_writel(VirtIODevice *vdev, uint32_t addr, uint32_t data){ VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint32_t val = data; if (addr > (vdev->config_len - sizeof(val))) return; stl_p(vdev->config + addr, val); if (k->set_config) { k->set_config(vdev, vdev->config); }}
1
int bdrv_open_image(BlockDriverState **pbs, const char *filename, QDict *options, const char *bdref_key, int flags, bool allow_none, Error **errp){ QDict *image_options; int ret; char *bdref_key_dot; const char *reference; assert(pbs); assert(*pbs == NULL); bdref_key_dot = g_strdup_printf("%s.", bdref_key); qdict_extra...
1
static void musb_packet(MUSBState *s, MUSBEndPoint *ep, int epnum, int pid, int len, USBCallback cb, int dir){ int ret; int idx = epnum && dir; int ttype; /* ep->type[0,1] contains: * in bits 7:6 the speed (0 - invalid, 1 - high, 2 - full, 3 - slow) * in bits 5:4 the transfer type (BULK / INT) * in bits 3:0 the EP num ...
1
bool st_set_trace_file(const char *file){ st_set_trace_file_enabled(false); free(trace_file_name); if (!file) { if (asprintf(&trace_file_name, CONFIG_TRACE_FILE, getpid()) < 0) { trace_file_name = NULL; return false; } } else { if (asprintf(&trace_file_name, "%s", file) < 0) { trace_file_name = NULL; return false; } } ...
1
static int kvm_client_migration_log(struct CPUPhysMemoryClient *client, int enable){ return kvm_set_migration_log(enable);}
1
static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, int index, AVClass *log_ctx){ char *opts = NULL; char *name = consume_string(buf); if(**buf == '=') { (*buf)++; opts = consume_string(buf); } return create_filter(graph, index, name, opts, log_ctx);}
1
static AVCodec *AVCodecInitialize(enum AVCodecID codec_id){ AVCodec *res; avcodec_register_all(); av_log_set_level(AV_LOG_PANIC); res = avcodec_find_decoder(codec_id); if (!res) error("Failed to find decoder"); return res;}
0
static int poll_rest(gboolean poll_msgs, HANDLE *handles, gint nhandles, GPollFD *fds, guint nfds, gint timeout){ DWORD ready; GPollFD *f; int recursed_result; if (poll_msgs) { /* Wait for either messages or handles * -> Use MsgWaitForMultipleObjectsEx */ ready = MsgWaitForMultipleObjectsEx(nhandles, handles, timeout, ...
0
int kvm_arch_pre_run(CPUState *env, struct kvm_run *run){ /* Inject NMI */ if (env->interrupt_request & CPU_INTERRUPT_NMI) { env->interrupt_request &= ~CPU_INTERRUPT_NMI; DPRINTF("injected NMI\n"); kvm_vcpu_ioctl(env, KVM_NMI); } if (!kvm_irqchip_in_kernel()) { /* Force the VCPU out of its inner loop to process the INI...
0
static void gen_msync(DisasContext *ctx){ /* interpreted as no-op */}
0
static void nvram_writeb (void *opaque, target_phys_addr_t addr, uint32_t value){ M48t59State *NVRAM = opaque; m48t59_write(NVRAM, addr, value & 0xff);}
0
static int json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush){ int char_consumed, new_state; lexer->x++; if (ch == '\n') { lexer->x = 0; lexer->y++; } do { new_state = json_lexer[lexer->state][(uint8_t)ch]; char_consumed = !TERMINAL_NEEDED_LOOKAHEAD(lexer->state, new_state); if (char_consumed) { qstring_append...
0
static int coroutine_fn qed_aio_write_alloc(QEDAIOCB *acb, size_t len){ BDRVQEDState *s = acb_to_s(acb); int ret; /* Cancel timer when the first allocating request comes in */ if (s->allocating_acb == NULL) { qed_cancel_need_check_timer(s); } /* Freeze this request if another allocating write is in progress */ if (s->a...
0
int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info){ BDRVQcow2State *s = bs->opaque; QCowSnapshot *new_snapshot_list = NULL; QCowSnapshot *old_snapshot_list = NULL; QCowSnapshot sn1, *sn = &sn1; int i, ret; uint64_t *l1_table = NULL; int64_t l1_table_offset; if (s->nb_snapshots >= QCOW_MAX_SNAPSH...
0
static void superio_ioport_writeb(void *opaque, uint32_t addr, uint32_t data){ int can_write; SuperIOConfig *superio_conf = opaque; DPRINTF("superio_ioport_writeb address 0x%x val 0x%x \n", addr, data); if (addr == 0x3f0) { superio_conf->index = data & 0xff; } else { /* 0x3f1 */ switch (superio_conf->index) { case 0x00...
0
static void monitor_handle_command1(void *opaque, const char *cmdline){ monitor_handle_command(cmdline); if (!monitor_suspended) monitor_start_input(); else monitor_suspended = 2;}
0
static void do_pci_unregister_device(PCIDevice *pci_dev){ pci_dev->bus->devices[pci_dev->devfn] = NULL; pci_config_free(pci_dev); if (memory_region_is_mapped(&pci_dev->bus_master_enable_region)) { memory_region_del_subregion(&pci_dev->bus_master_container_region, &pci_dev->bus_master_enable_region); } address_space_des...
0
CPUState *ppc405cr_init (target_phys_addr_t ram_bases[4], target_phys_addr_t ram_sizes[4], uint32_t sysclk, qemu_irq **picp, int do_init){ clk_setup_t clk_setup[PPC405CR_CLK_NB]; qemu_irq dma_irqs[4]; CPUState *env; qemu_irq *pic, *irqs; memset(clk_setup, 0, sizeof(clk_setup)); env = ppc4xx_init("405cr", &clk_setup[PPC...
0
int nbd_client_session_co_discard(NbdClientSession *client, int64_t sector_num, int nb_sectors){ struct nbd_request request = { .type = NBD_CMD_TRIM }; struct nbd_reply reply; ssize_t ret; if (!(client->nbdflags & NBD_FLAG_SEND_TRIM)) { return 0; } request.from = sector_num * 512; request.len = nb_sectors * 512; nbd_co...
0
static void sdhci_do_adma(SDHCIState *s){ unsigned int n, begin, length; const uint16_t block_size = s->blksize & 0x0fff; ADMADescr dscr; int i; for (i = 0; i < SDHC_ADMA_DESCS_PER_DELAY; ++i) { s->admaerr &= ~SDHC_ADMAERR_LENGTH_MISMATCH; get_adma_description(s, &dscr); DPRINT_L2("ADMA loop: addr=" TARGET_FMT_plx ", l...
0
static uint32_t omap_sysctl_read8(void *opaque, target_phys_addr_t addr){ struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque; int pad_offset, byte_offset; int value; switch (addr) { case 0x030 ... 0x140:/* CONTROL_PADCONF - only used in the POP */ pad_offset = (addr - 0x30) >> 2; byte_offset = (addr - 0x30) & (4...
0
abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size){ void *ptr, *prev; abi_ulong addr; int wrapped, repeat; /* If 'start' == 0, then a default start address is used. */ if (start == 0) { start = mmap_next_start; } else { start &= qemu_host_page_mask; } size = HOST_PAGE_ALIGN(size); if (RESERVED_VA) { return mmap_f...
0
static int do_token_out(USBDevice *s, USBPacket *p){ assert(p->devep == 0); switch(s->setup_state) { case SETUP_STATE_ACK: if (s->setup_buf[0] & USB_DIR_IN) { s->setup_state = SETUP_STATE_IDLE; /* transfer OK */ } else { /* ignore additional output */ } return 0; case SETUP_STATE_DATA: if (!(s->setup_buf[0] & USB_DIR_I...
0
int page_unprotect(target_ulong address, uintptr_t pc){ unsigned int prot; PageDesc *p; target_ulong host_start, host_end, addr; /* Technically this isn't safe inside a signal handler. However we know this only ever happens in a synchronous SEGV handler, so in practice it seems to be ok. */ mmap_lock(); p = page_find(a...
0
static void truncpasses(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile){ int precno, compno, reslevelno, bandno, cblkno, lev; Jpeg2000CodingStyle *codsty = &s->codsty; for (compno = 0; compno < s->ncomponents; compno++){ Jpeg2000Component *comp = tile->comp + compno; for (reslevelno = 0, lev = codsty->nreslevels-1; resl...
1
uint64_t blk_mig_bytes_remaining(void){ return blk_mig_bytes_total() - blk_mig_bytes_transferred();}
1
static int init_tile(Jpeg2000DecoderContext *s, int tileno){ int compno; int tilex = tileno % s->numXtiles; int tiley = tileno / s->numXtiles; Jpeg2000Tile *tile = s->tile + tileno; if (!tile->comp) return AVERROR(ENOMEM); tile->coord[0][0] = av_clip(tilex * s->tile_width + s->tile_offset_x, s->image_offset_x, s->width...
1
static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt){ SRTContext *srt = avf->priv_data; int write_ts = avf->streams[0]->codec->codec_id != AV_CODEC_ID_SRT; srt->index++; if (write_ts) { int64_t s = pkt->pts, e, d = pkt->duration; if (d <= 0) /* For backward compatibility, fallback to convergence_duration. *...
0
static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr){ FlacEncodeContext *s; int frame_bytes, out_bytes, ret; s = avctx->priv_data; /* when the last block is reached, update the header in extradata */ if (!frame) { s->max_framesize = s->max_encoded_framesize; av...
0
void ff_vp3_v_loop_filter_mmx(uint8_t *src, int stride, int *bounding_values){ __asm__ volatile( "movq %0, %%mm6 \n\t" "movq %1, %%mm4 \n\t" "movq %2, %%mm2 \n\t" "movq %3, %%mm1 \n\t" VP3_LOOP_FILTER(%4) "movq %%mm4, %1 \n\t" "movq %%mm3, %2 \n\t" : "+m" (*(uint64_t*)(src - 2*stride)), "+m" (*(uint64_t*)(src - 1*strid...
0
static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end; uint8_t segment_type; int segment_length; int i, ret; av_dlog(avctx, "PGS sub packet:\n"); for (i = 0; i < buf_size; i++) { av_dlog(avctx, "%02x ",...
0
static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc){ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !st->codec->sample_rate && sc->time_scale > 1) st->codec->sample_rate = sc->time_scale; /* special codec parameters handling */ switch (st->codec->codec_id) {#if CON...
1
void OPPROTO op_srli_T1 (void){ T1 = T1 >> PARAM1; RETURN();}
1
static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx){ int pic_size_indx, i, p; IVIPicConfig pic_conf; if (get_bits(&ctx->gb, 18) != 0x3FFF8) { av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\n"); return AVERROR_INVALIDDATA; } ctx->prev_frame_type = ctx->frame_type; ctx->frame_type = get_bits(...
0
void ff_vp3_idct_add_altivec(uint8_t *dst, int stride, DCTELEM block[64]){ LOAD_ZERO; vec_u8 t, vdst; vec_s16 vdst_16; vec_u8 vdst_mask = vec_mergeh(vec_splat_u8(-1), vec_lvsl(0, dst)); IDCT_START IDCT_1D(NOP, NOP) TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7); IDCT_1D(ADD8, SHIFT4)#define ADD(a)\ vdst = vec_ld(0, dst);\ ...
1
static void qobject_output_type_uint64(Visitor *v, const char *name, uint64_t *obj, Error **errp){ /* FIXME values larger than INT64_MAX become negative */ QObjectOutputVisitor *qov = to_qov(v); qobject_output_add(qov, name, qnum_from_int(*obj));}
1
static int asf_read_replicated_data(AVFormatContext *s, ASFPacket *asf_pkt){ ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; int ret; if (!asf_pkt->data_size) { asf_pkt->data_size = asf_pkt->size_left = avio_rl32(pb); // read media object size if (asf_pkt->data_size <= 0) return AVERROR_INVALIDDATA; if ((ret =...
1
float64 float64_muladd(float64 a, float64 b, float64 c, int flags STATUS_PARAM){ flag aSign, bSign, cSign, zSign; int_fast16_t aExp, bExp, cExp, pExp, zExp, expDiff; uint64_t aSig, bSig, cSig; flag pInf, pZero, pSign; uint64_t pSig0, pSig1, cSig0, cSig1, zSig0, zSig1; int shiftcount; flag signflip, infzero; a = float64...
1
static void vga_precise_update_retrace_info(VGACommonState *s){ int htotal_chars; int hretr_start_char; int hretr_skew_chars; int hretr_end_char; int vtotal_lines; int vretr_start_line; int vretr_end_line; int dots;#if 0 int div2, sldiv2;#endif int clocking_mode; int clock_sel; const int clk_hz[] = {25175000, 28322000,...
1
static void diag288_timer_expired(void *dev){ qemu_log_mask(CPU_LOG_RESET, "Watchdog timer expired.\n"); watchdog_perform_action(); /* Reset the watchdog only if the guest was notified about expiry. */ switch (get_watchdog_action()) { case WDT_DEBUG: case WDT_NONE: case WDT_PAUSE: return; } wdt_diag288_reset(dev);}
1
void pcie_aer_inject_error_print(Monitor *mon, const QObject *data){ QDict *qdict; int devfn; assert(qobject_type(data) == QTYPE_QDICT); qdict = qobject_to_qdict(data); devfn = (int)qdict_get_int(qdict, "devfn"); monitor_printf(mon, "OK id: %s root bus: %s, bus: %x devfn: %x.%x\n", qdict_get_str(qdict, "id"), qdict_get...
1
static void gen_branch(DisasContext *ctx, int insn_bytes){ if (ctx->hflags & MIPS_HFLAG_BMASK) { int proc_hflags = ctx->hflags & MIPS_HFLAG_BMASK; /* Branches completion */ ctx->hflags &= ~MIPS_HFLAG_BMASK; ctx->bstate = BS_BRANCH; save_cpu_state(ctx, 0); /* FIXME: Need to clear can_do_io. */ switch (proc_hflags & MIPS...
0
static int flac_encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, void *data){ FlacEncodeContext *s; const int16_t *samples = data; int frame_bytes, out_bytes; s = avctx->priv_data; /* when the last block is reached, update the header in extradata */ if (!data) { s->max_framesize = s->max_encoded_frames...
0
static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; DNXHDContext *ctx = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *picture = data; int first_field = 1; int ret, i; ff_dlog(avctx, "frame size %...
1
static void encode_gray_bitstream(HYuvContext *s, int count){ int i; count/=2; if(s->flags&CODEC_FLAG_PASS1){ for(i=0; i<count; i++){ s->stats[0][ s->temp[0][2*i ] ]++; s->stats[0][ s->temp[0][2*i+1] ]++; } }else if(s->context){ for(i=0; i<count; i++){ s->stats[0][ s->temp[0][2*i ] ]++; put_bits(&s->pb, s->len[0][ s->t...
1
qemu_irq qemu_irq_invert(qemu_irq irq){ /* The default state for IRQs is low, so raise the output now. */ qemu_irq_raise(irq); return qemu_allocate_irqs(qemu_notirq, irq, 1)[0];}
1
static int dca_exss_parse_asset_header(DCAContext *s){ int header_pos = get_bits_count(&s->gb); int header_size; int channels; int embedded_stereo = 0; int embedded_6ch = 0; int drc_code_present; int extensions_mask; int i, j; if (get_bits_left(&s->gb) < 16) return -1; /* We will parse just enough to get to the extensi...
1
void ff_aac_search_for_ltp(AACEncContext *s, SingleChannelElement *sce, int common_window){ int w, g, w2, i, start = 0, count = 0; int saved_bits = -(15 + FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB)); float *C34 = &s->scoefs[128*0], *PCD = &s->scoefs[128*1]; float *PCD34 = &s->scoefs[128*2]; const int max_ltp = FFMIN(sce...
1
static void gen_std(DisasContext *ctx){ int rs; TCGv EA; rs = rS(ctx->opcode); if ((ctx->opcode & 0x3) == 0x2) {#if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);#else /* stq */ if (unlikely(ctx->mem_idx == 0)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } if (unlikely(rs & 1)...
1
static int parse_vtrk(AVFormatContext *s, FourxmDemuxContext *fourxm, uint8_t *buf, int size, int left){ AVStream *st; /* check that there is enough data */ if (size != vtrk_SIZE || left < size + 8) { return AVERROR_INVALIDDATA; } /* allocate a new AVStream */ st = avformat_new_stream(s, NULL); if (!st) return AVERROR(...
1
static void free_test_data(test_data *data){ AcpiSdtTable *temp; int i; g_free(data->rsdt_tables_addr); for (i = 0; i < data->tables->len; ++i) { temp = &g_array_index(data->tables, AcpiSdtTable, i); g_free(temp->aml); if (temp->aml_file && !temp->tmp_files_retain && g_strstr_len(temp->aml_file, -1, "aml-")) { unlink(t...
1
static void draw_digit(int digit, uint8_t *dst, unsigned dst_linesize, unsigned segment_width){#define TOP_HBAR 1#define MID_HBAR 2#define BOT_HBAR 4#define LEFT_TOP_VBAR 8#define LEFT_BOT_VBAR 16#define RIGHT_TOP_VBAR 32#define RIGHT_BOT_VBAR 64 struct { int x, y, w, h; } segments[] = { { 1, 0, 5, 1 }, /* TOP_HBAR */ ...
0
static int query_formats(AVFilterGraph *graph, AVClass *log_ctx){ int i, j, ret; int scaler_count = 0, resampler_count = 0; int count_queried = 0, count_merged = 0, count_already_merged = 0, count_delayed = 0; for (i = 0; i < graph->nb_filters; i++) { AVFilterContext *f = graph->filters[i]; if (formats_declared(f)) con...
0
static inline void mix_2f_1r_to_stereo(AC3DecodeContext *ctx){ int i; float (*output)[256] = ctx->audio_block.block_output; for (i = 0; i < 256; i++) { output[1][i] += output[2][i]; output[2][i] += output[3][i]; } memset(output[3], 0, sizeof(output[3]));}
0
static int decode_cabac_mb_cbp_chroma( H264Context *h) { int ctx; int cbp_a, cbp_b; cbp_a = (h->left_cbp>>4)&0x03; cbp_b = (h-> top_cbp>>4)&0x03; ctx = 0; if( cbp_a > 0 ) ctx++; if( cbp_b > 0 ) ctx += 2; if( get_cabac( &h->cabac, &h->cabac_state[77 + ctx] ) == 0 ) return 0; ctx = 4; if( cbp_a == 2 ) ctx++; if( cbp_b ==...
0
static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt){ MP3Context *mp3 = s->priv_data; if (pkt && pkt->data && pkt->size >= 4) { MPADecodeHeader c; int av_unused base; avpriv_mpegaudio_decode_header(&c, AV_RB32(pkt->data)); if (!mp3->initial_bitrate) mp3->initial_bitrate = c.bit_rate; if ((c.bit_rate == ...
0
int has_altivec(void){#ifdef __AMIGAOS4__ ULONG result = 0; extern struct ExecIFace *IExec; IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE); if (result == VECTORTYPE_ALTIVEC) return 1; return 0;#else /* __AMIGAOS4__ */#ifdef SYS_DARWIN int sels[2] = {CTL_HW, HW_VECTORUNIT}; int has_vu = 0; size_t len = sizeof...
0
static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size){ AVCodecContext *avctx = s->avctx; Mpeg1Context *s1 = (Mpeg1Context *) s; int ret; if (s->picture_structure == PICT_FRAME) s->first_field = 0; else s->first_field ^= 1; /* start frame decoding */ if (s->first_field || s->picture_structure ...
1
static inline int cris_bound_w(int v, int b){int r = v;asm ("bound.w\t%1, %0\n" : "+r" (r) : "ri" (b));return r;}
1
static void mpeg_decode_picture_coding_extension(MpegEncContext *s){ s->full_pel[0] = s->full_pel[1] = 0; s->mpeg_f_code[0][0] = get_bits(&s->gb, 4); s->mpeg_f_code[0][1] = get_bits(&s->gb, 4); s->mpeg_f_code[1][0] = get_bits(&s->gb, 4); s->mpeg_f_code[1][1] = get_bits(&s->gb, 4); s->intra_dc_precision = get_bits(&s->g...
1
static int xen_remove_from_physmap(XenIOState *state, hwaddr start_addr, ram_addr_t size){ unsigned long i = 0; int rc = 0; XenPhysmap *physmap = NULL; hwaddr phys_offset = 0; physmap = get_physmapping(state, start_addr, size); if (physmap == NULL) { return -1; } phys_offset = physmap->phys_offset; size = physmap->size...
1
static int mpegvideo_probe(AVProbeData *p){ uint32_t code= -1; int pic=0, seq=0, slice=0, pspack=0, vpes=0, apes=0, res=0, sicle=0; int i; uint32_t last = 0; for(i=0; i<p->buf_size; i++){ code = (code<<8) + p->buf[i]; if ((code & 0xffffff00) == 0x100) { switch(code){ case SEQ_START_CODE: seq++; break; case PICTURE_STAR...
1
static void usb_ohci_init(OHCIState *ohci, DeviceState *dev, int num_ports, dma_addr_t localmem_base, char *masterbus, uint32_t firstport, AddressSpace *as, Error **errp){ Error *err = NULL; int i; ohci->as = as; if (usb_frame_time == 0) {#ifdef OHCI_TIME_WARP usb_frame_time = NANOSECONDS_PER_SECOND; usb_bit_time = NAN...
1
static void isabus_fdc_class_init(ObjectClass *klass, void *data){ DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = isabus_fdc_realize; dc->fw_name = "fdc"; dc->no_user = 1; dc->reset = fdctrl_external_reset_isa; dc->vmsd = &vmstate_isa_fdc; dc->props = isa_fdc_properties; set_bit(DEVICE_CATEGORY_STORAGE, dc->categ...
0
static int64_t expr_unary(Monitor *mon){ int64_t n; char *p; int ret; switch(*pch) { case '+': next(); n = expr_unary(mon); break; case '-': next(); n = -expr_unary(mon); break; case '~': next(); n = ~expr_unary(mon); break; case '(': next(); n = expr_sum(mon); if (*pch != ')') { expr_error(mon, "')' expected"); } next...
0
mst_fpga_writeb(void *opaque, target_phys_addr_t addr, uint32_t value){mst_irq_state *s = (mst_irq_state *) opaque;value &= 0xffffffff;switch (addr) {case MST_LEDDAT1:s->leddat1 = value;break;case MST_LEDDAT2:s->leddat2 = value;break;case MST_LEDCTRL:s->ledctrl = value;break;case MST_GPSWR:s->gpswr = value;break;case M...
0
static int get_std_framerate(int i){ if(i<60*12) return i*1001; else return ((const int[]){24,30,60,12,15,48})[i-60*12]*1000*12;}
0
void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty){ int reslevelno, bandno, precno; for (reslevelno = 0; comp->reslevel && reslevelno < codsty->nreslevels; reslevelno++) { Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno; for (bandno = 0; bandno < reslevel->nbands; bandno++) { Jpeg20...
0
static void do_cont(int argc, const char **argv){ vm_start();}
0
static inline void _t_gen_mov_TN_env(TCGv tn, int offset){ if (offset > sizeof(CPUCRISState)) { fprintf(stderr, "wrong load from env from off=%d\n", offset); } tcg_gen_ld_tl(tn, cpu_env, offset);}
0
static const char *bdrv_get_parent_name(const BlockDriverState *bs){ BdrvChild *c; const char *name; /* If multiple parents have a name, just pick the first one. */ QLIST_FOREACH(c, &bs->parents, next_parent) { if (c->role->get_name) { name = c->role->get_name(c); if (name && *name) { return name; } } } return NULL;}