label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
0
void ff_set_mpeg4_time(MpegEncContext * s){ if(s->pict_type==AV_PICTURE_TYPE_B){ ff_mpeg4_init_direct_mv(s); }else{ s->last_time_base= s->time_base; s->time_base= s->time/s->avctx->time_base.den; } }
18,496
1
static int skeleton_header(AVFormatContext *s, int idx) { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; AVStream *st = s->streams[idx]; uint8_t *buf = os->buf + os->pstart; int version_major, version_minor; int64_t start_num, start_den, start_granule; int target_idx, start_time; strcpy(st-...
18,498
1
static void virtio_net_set_status(struct VirtIODevice *vdev, uint8_t status) { VirtIONet *n = VIRTIO_NET(vdev); VirtIONetQueue *q; int i; uint8_t queue_status; virtio_net_vnet_endian_status(n, status); virtio_net_vhost_status(n, status); for (i = 0; i < n->max_queues; i++) { NetClientState *ncs = qemu_get_subqueue(n->n...
18,499
0
static void alloc_picture(void *opaque) { VideoState *is = opaque; VideoPicture *vp; vp = &is->pictq[is->pictq_windex]; if (vp->bmp) SDL_FreeYUVOverlay(vp->bmp); #if CONFIG_AVFILTER if (vp->picref) avfilter_unref_buffer(vp->picref); vp->picref = NULL; vp->width = is->out_video_filter->inputs[0]->w; vp->height = is->out...
18,500
0
static void int_to_int16(int16_t *out, const int *inp) { int i; for (i=0; i<30; i++) *(out++) = *(inp++); }
18,502
0
static int decode_frame_adu(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MPADecodeContext *s = avctx->priv_data; uint32_t header; int len, ret; len = buf_size; // Discard too short frames if (buf_size < HEADER_SIZE) { av_log(avct...
18,504
0
static void fill_caches(H264Context *h, int mb_type, int for_deblock){ MpegEncContext * const s = &h->s; const int mb_xy= h->mb_xy; int topleft_xy, top_xy, topright_xy, left_xy[2]; int topleft_type, top_type, topright_type, left_type[2]; int * left_block; int topleft_partition= -1; int i; top_xy = mb_xy - (s->mb_stride...
18,505
1
int virtio_gpu_create_mapping_iov(struct virtio_gpu_resource_attach_backing *ab, struct virtio_gpu_ctrl_command *cmd, struct iovec **iov) { struct virtio_gpu_mem_entry *ents; size_t esize, s; int i; if (ab->nr_entries > 16384) { qemu_log_mask(LOG_GUEST_ERROR, "%s: nr_entries is too big (%d > 16384)\n", __func__, ab->nr...
18,506
1
static int check_refcounts_l2(BlockDriverState *bs, uint16_t *refcount_table, int refcount_table_size, int64_t l2_offset, int check_copied) { BDRVQcowState *s = bs->opaque; uint64_t *l2_table, offset; int i, l2_size, nb_csectors, refcount; int errors = 0; /* Read L2 table from disk */ l2_size = s->l2_size * sizeof(uint...
18,507
0
static inline void direct_ref_list_init(H264Context * const h){ MpegEncContext * const s = &h->s; Picture * const ref1 = &h->ref_list[1][0]; Picture * const cur = s->current_picture_ptr; int list, i, j; int sidx= s->picture_structure&1; int ref1sidx= ref1->reference&1; for(list=0; list<2; list++){ cur->ref_count[sidx][...
18,508
1
static inline void tm2_high_chroma(int *data, int stride, int *last, int *CD, int *deltas) { int i, j; for (j = 0; j < 2; j++) { for (i = 0; i < 2; i++) { CD[j] += deltas[i + j * 2]; last[i] += CD[j]; data[i] = last[i]; } data += stride; } }
18,509
1
static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset, size_t size) { int64_t len; if (!bdrv_is_inserted(bs)) return -ENOMEDIUM; if (bs->growable) return 0; len = bdrv_getlength(bs); if ((offset + size) > len) return -EIO; return 0; }
18,510
1
static int aiff_read_header(AVFormatContext *s) { int ret, size, filesize; int64_t offset = 0, position; uint32_t tag; unsigned version = AIFF_C_VERSION1; AVIOContext *pb = s->pb; AVStream * st; AIFFInputContext *aiff = s->priv_data; ID3v2ExtraMeta *id3v2_extra_meta = NULL; /* check FORM header */ filesize = get_tag(pb...
18,511
1
static int qemu_signal_init(void) { int sigfd; sigset_t set; #ifdef CONFIG_IOTHREAD /* SIGUSR2 used by posix-aio-compat.c */ sigemptyset(&set); sigaddset(&set, SIGUSR2); pthread_sigmask(SIG_UNBLOCK, &set, NULL); /* * SIG_IPI must be blocked in the main thread and must not be caught * by sigwait() in the signal thread. ...
18,514
1
static void gen_neon_dup_high16(TCGv var) { TCGv tmp = new_tmp(); tcg_gen_andi_i32(var, var, 0xffff0000); tcg_gen_shri_i32(tmp, var, 16); tcg_gen_or_i32(var, var, tmp); dead_tmp(tmp); }
18,515
1
static void lx60_net_init(MemoryRegion *address_space, hwaddr base, hwaddr descriptors, hwaddr buffers, qemu_irq irq, NICInfo *nd) { DeviceState *dev; SysBusDevice *s; MemoryRegion *ram; dev = qdev_create(NULL, "open_eth"); qdev_set_nic_properties(dev, nd); qdev_init_nofail(dev); s = SYS_BUS_DEVICE(dev); sysbus_connect...
18,516
1
void destroy_nic(dev_match_fn *match_fn, void *arg) { int i; NICInfo *nic; for (i = 0; i < MAX_NICS; i++) { nic = &nd_table[i]; if (nic->used) { if (nic->private && match_fn(nic->private, arg)) { if (nic->vlan) { VLANClientState *vc; vc = qemu_find_vlan_client(nic->vlan, nic->private); if (vc) qemu_del_vlan_client(vc);...
18,517
0
static av_cold int pcm_encode_close(AVCodecContext *avctx) { av_freep(&avctx->coded_frame); return 0; }
18,519
0
static void extract_exponents(AC3EncodeContext *s) { int blk, ch, i; for (ch = 0; ch < s->channels; ch++) { for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) { AC3Block *block = &s->blocks[blk]; for (i = 0; i < AC3_MAX_COEFS; i++) { int e; int v = abs(SCALE_COEF(block->mdct_coef[ch][i])); if (v == 0) e = 24; else { e = 23 - a...
18,520
0
static av_cold int nvenc_dyload_cuda(AVCodecContext *avctx) { NvencContext *ctx = avctx->priv_data; NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs; #if CONFIG_CUDA dl_fn->cu_init = cuInit; dl_fn->cu_device_get_count = cuDeviceGetCount; dl_fn->cu_device_get = cuDeviceGet; dl_fn->cu_device_get_name = cuDeviceGetN...
18,521
0
static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) { MpegTSContext *ts = filter->u.section_filter.opaque; MpegTSSectionFilter *tssf = &filter->u.section_filter; SectionHeader h1, *h = &h1; const uint8_t *p, *p_end; int sid, pmt_pid; AVProgram *program; av_log(ts->stream, AV_LOG_TRACE, "PA...
18,522
1
int ff_wma_init(AVCodecContext * avctx, int flags2) { WMACodecContext *s = avctx->priv_data; int i; float *window; float bps1, high_freq; volatile float bps; int sample_rate1; int coef_vlc_table; s->sample_rate = avctx->sample_rate; s->nb_channels = avctx->channels; s->bit_rate = avctx->bit_rate; s->block_align = avctx...
18,525
1
void do_blockdev_backup(BlockdevBackup *backup, BlockJobTxn *txn, Error **errp) { BlockDriverState *bs; BlockDriverState *target_bs; Error *local_err = NULL; AioContext *aio_context; if (!backup->has_speed) { backup->speed = 0; } if (!backup->has_on_source_error) { backup->on_source_error = BLOCKDEV_ON_ERROR_REPORT; } ...
18,526
1
static int decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, int size) { GetBitContext gb; init_get_bits(&gb, buf, size * 8); adts->objecttype = get_bits(&gb, 5) - 1; adts->sample_rate_index = get_bits(&gb, 4); adts->channel_conf = get_bits(&gb, 4); if (adts->objecttype > 3) { av_log(s, AV_LOG_ERROR...
18,527
1
static int scsi_write_data(SCSIDevice *d, uint32_t tag) { SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, d); SCSIGenericReq *r; int ret; DPRINTF("scsi_write_data 0x%x\n", tag); r = scsi_find_request(s, tag); if (!r) { BADF("Bad write tag 0x%x\n", tag); /* ??? This is the wrong error. */ scsi_command_complete(r...
18,530
1
static void sd_reset(SDState *sd, BlockDriverState *bdrv) { uint64_t size; uint64_t sect; if (bdrv) { bdrv_get_geometry(bdrv, &sect); } else { sect = 0; } sect <<= 9; size = sect + 1; sect = (size >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)) + 1; sd->state = sd_idle_state; sd->rca = 0x0000; sd_set_ocr(sd); sd_set...
18,531
0
static void arm_idct_put(UINT8 *dest, int line_size, DCTELEM *block) { j_rev_dct_ARM (block); put_pixels_clamped(block, dest, line_size); }
18,532
0
int ff_lpc_calc_coefs(DSPContext *s, const int32_t *samples, int blocksize, int max_order, int precision, int32_t coefs[][MAX_LPC_ORDER], int *shift, int use_lpc, int omethod, int max_shift, int zero_shift) { double autoc[MAX_LPC_ORDER+1]; double ref[MAX_LPC_ORDER]; double lpc[MAX_LPC_ORDER][MAX_LPC_ORDER]; int i, j, p...
18,533
0
static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed) { if (get_rac(c, state + 0)) return 0; else { int i, e, a; e = 0; while (get_rac(c, state + 1 + FFMIN(e, 9))) // 1..10 e++; a = 1; for (i = e - 1; i >= 0; i--) a += a + get_rac(c, state + 22 + FFMIN(i, 9)); // 22..31 e = -(is_s...
18,534
0
static int theora_decode_tables(AVCodecContext *avctx, GetBitContext gb) { Vp3DecodeContext *s = avctx->priv_data; int i, n, matrices; if (s->theora >= 0x030200) { n = get_bits(&gb, 3); /* loop filter limit values table */ for (i = 0; i < 64; i++) s->filter_limit_values[i] = get_bits(&gb, n); } if (s->theora >= 0x03020...
18,535
0
static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id) { int max_frames, first_frames = 0, frames; const uint8_t *buf, *buf2, *end; enum AVCodecID codec_id = AV_CODEC_ID_AC3; max_frames = 0; buf = p->buf; end = buf + p->buf_size; for(; buf < end; buf++) { if(buf > p->buf && !(buf[0] == 0x0B && buf[...
18,536
0
static int segment_end(AVFormatContext *oc, int write_trailer) { int ret = 0; av_write_frame(oc, NULL); /* Flush any buffered data (fragmented mp4) */ if (write_trailer) av_write_trailer(oc); avio_close(oc->pb); return ret; }
18,537
0
AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c) { AVStream *st; int i; if (av_reallocp_array(&s->streams, s->nb_streams + 1, sizeof(*s->streams)) < 0) { s->nb_streams = 0; return NULL; } st = av_mallocz(sizeof(AVStream)); if (!st) return NULL; if (!(st->info = av_mallocz(sizeof(*st->info)))) { av_fr...
18,538
0
static int cdxa_probe(AVProbeData *p) { /* check file header */ if (p->buf[0] == 'R' && p->buf[1] == 'I' && p->buf[2] == 'F' && p->buf[3] == 'F' && p->buf[8] == 'C' && p->buf[9] == 'D' && p->buf[10] == 'X' && p->buf[11] == 'A') return AVPROBE_SCORE_MAX; else return 0; }
18,539
0
static int set_string_fmt(void *obj, const AVOption *o, const char *val, uint8_t *dst, int fmt_nb, int ((*get_fmt)(const char *)), const char *desc) { int fmt; if (!val || !strcmp(val, "none")) { fmt = -1; } else { fmt = get_fmt(val); if (fmt == -1) { char *tail; fmt = strtol(val, &tail, 0); if (*tail || (unsigned)fmt ...
18,540
0
static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) { /* estimate the frame's complexity as a sum of weighted dwt coefs. * FIXME we know exact mv bits at this point, * but ratecontrol isn't set up to include them. */ uint32_t coef_sum= 0; int level, orientation, delta_qlog; for(level=0; level<s->spatial_decompo...
18,542
0
static void lsp2lpc(int16_t *lpc) { int f1[LPC_ORDER / 2 + 1]; int f2[LPC_ORDER / 2 + 1]; int i, j; /* Calculate negative cosine */ for (j = 0; j < LPC_ORDER; j++) { int index = lpc[j] >> 7; int offset = lpc[j] & 0x7f; int temp1 = cos_tab[index] << 16; int temp2 = (cos_tab[index + 1] - cos_tab[index]) * ((offset << 8) ...
18,544
0
static inline void mix_3f_2r_to_dolby(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[4][i] - output[5][i]); output[2][i] += (output[3][i] + output[4][i] + output[5][i]); } memset(output[3], 0, sizeof(output[3])); m...
18,546
0
static int ffm_read_header(AVFormatContext *s) { FFMContext *ffm = s->priv_data; AVStream *st; AVIOContext *pb = s->pb; AVCodecContext *codec; int i, nb_streams; uint32_t tag; /* header */ tag = avio_rl32(pb); if (tag == MKTAG('F', 'F', 'M', '2')) return ffm2_read_header(s); if (tag != MKTAG('F', 'F', 'M', '1')) goto f...
18,547
0
static int svq3_decode_mb (H264Context *h, unsigned int mb_type) { int i, j, k, m, dir, mode; int cbp = 0; uint32_t vlc; int8_t *top, *left; MpegEncContext *const s = (MpegEncContext *) h; const int mb_xy = s->mb_x + s->mb_y*s->mb_stride; const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; h->top_samples_available = (s...
18,548
0
static void rtsp_send_cmd (AVFormatContext *s, const char *cmd, RTSPMessageHeader *reply, unsigned char **content_ptr) { rtsp_send_cmd_async(s, cmd, reply, content_ptr); rtsp_read_reply(s, reply, content_ptr, 0); }
18,549
1
static int rtsp_read_header(AVFormatContext *s, AVFormatParameters *ap) { RTSPState *rt = s->priv_data; int ret; ret = ff_rtsp_connect(s); if (ret) return ret; rt->real_setup_cache = av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache)); if (!rt->real_setup_cache) return AVERROR(ENOMEM); rt->real_setup = rt->re...
18,550
1
static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v) { XHCIInterrupter *intr; dma_addr_t erdp; unsigned int dp_idx; if (v >= xhci->numintrs) { DPRINTF("intr nr out of range (%d >= %d)\n", v, xhci->numintrs); return; } intr = &xhci->intr[v]; if (intr->er_full) { DPRINTF("xhci_event(): ER full, queueing\n"); ...
18,551
1
static void ehci_advance_state(EHCIState *ehci, int async) { EHCIQueue *q = NULL; int again; do { switch(ehci_get_state(ehci, async)) { case EST_WAITLISTHEAD: again = ehci_state_waitlisthead(ehci, async); break; case EST_FETCHENTRY: again = ehci_state_fetchentry(ehci, async); break; case EST_FETCHQH: q = ehci_state_fet...
18,552
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...
18,553
1
void do_device_add(Monitor *mon, const QDict *qdict) { QemuOpts *opts; opts = qemu_opts_parse(&qemu_device_opts, qdict_get_str(qdict, "config"), "driver"); if (opts && !qdev_device_help(opts)) qdev_device_add(opts); }
18,554
1
static void update_irq(struct xlx_pic *p) { uint32_t i; /* level triggered interrupt */ if (p->regs[R_MER] & 2) { p->regs[R_ISR] |= p->irq_pin_state & ~p->c_kind_of_intr; } /* Update the pending register. */ p->regs[R_IPR] = p->regs[R_ISR] & p->regs[R_IER]; /* Update the vector register. */ for (i = 0; i < 32; i++) { i...
18,555
1
static void init_proc_e500 (CPUPPCState *env, int version) { uint32_t tlbncfg[2]; uint64_t ivor_mask = 0x0000000F0000FFFFULL; #if !defined(CONFIG_USER_ONLY) int i; #endif /* Time base */ gen_tbl(env); /* * XXX The e500 doesn't implement IVOR7 and IVOR9, but doesn't * complain when accessing them. * gen_spr_BookE(env, 0...
18,558
1
static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info) { SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl); info->memslot_gen_bits = MEMSLOT_GENERATION_BITS; info->memslot_id_bits = MEMSLOT_SLOT_BITS; info->num_memslots = NUM_MEMSLOTS; info->num_memslots_groups = NUM_MEMSLOTS_GRO...
18,563
1
static void mpc8_parse_seektable(AVFormatContext *s, int64_t off) { MPCContext *c = s->priv_data; int tag; int64_t size, pos, ppos[2]; uint8_t *buf; int i, t, seekd; GetBitContext gb; avio_seek(s->pb, off, SEEK_SET); mpc8_get_chunk_header(s->pb, &tag, &size); if(tag != TAG_SEEKTABLE){ av_log(s, AV_LOG_ERROR, "No seek t...
18,564
1
static void esp_do_dma(ESPState *s) { uint32_t len; int to_device; to_device = (s->ti_size < 0); len = s->dma_left; if (s->do_cmd) { DPRINTF("command len %d + %d\n", s->cmdlen, len); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len); s->ti_size = 0; s->cmdlen = 0; s->do_cmd = 0; do_cmd(s, s->cmdbuf); return...
18,565
1
void ide_sector_write(IDEState *s) { int64_t sector_num; int n; s->status = READY_STAT | SEEK_STAT | BUSY_STAT; sector_num = ide_get_sector(s); #if defined(DEBUG_IDE) printf("sector=%" PRId64 "\n", sector_num); #endif n = s->nsector; if (n > s->req_nb_sectors) { n = s->req_nb_sectors; s->iov.iov_base = s->io_buffer; s-...
18,566
1
static void openrisc_sim_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; OpenRISCCPU *cpu = NULL; MemoryRegion *ram; int n; if (!cpu_model) { cpu_model = "or1200"; } for (n = 0; n < smp_cpus; n++) ...
18,567
0
static int decode_block_coeffs_internal(VP56RangeCoder *c, DCTELEM block[16], uint8_t probs[16][3][NUM_DCT_TOKENS-1], int i, uint8_t *token_prob, int16_t qmul[2]) { goto skip_eob; do { int coeff; if (!vp56_rac_get_prob_branchy(c, token_prob[0])) // DCT_EOB return i; skip_eob: if (!vp56_rac_get_prob_branchy(c, token_pro...
18,568
0
yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y, enum AVPixelFormat target) { const uint8_t * const d128=dither_...
18,569
0
int ff_rate_control_init(MpegEncContext *s) { RateControlContext *rcc= &s->rc_context; int i; char *error = NULL; static const char *const_names[]={ "PI", "E", "iTex", "pTex", "tex", "mv", "fCode", "iCount", "mcVar", "var", "isI", "isP", "isB", "avgQP", "qComp", /* "lastIQP", "lastPQP", "lastBQP", "nextNonBQP",*/ "avgI...
18,570
1
bool sysbus_has_irq(SysBusDevice *dev, int n) { char *prop = g_strdup_printf("%s[%d]", SYSBUS_DEVICE_GPIO_IRQ, n); ObjectProperty *r; r = object_property_find(OBJECT(dev), prop, NULL); return (r != NULL); }
18,572
1
static int coroutine_fn bdrv_co_block_status(BlockDriverState *bs, bool want_zero, int64_t offset, int64_t bytes, int64_t *pnum, int64_t *map, BlockDriverState **file) { int64_t total_size; int64_t n; /* bytes */ int ret; int64_t local_map = 0; BlockDriverState *local_file = NULL; int64_t aligned_offset, aligned_bytes;...
18,573
1
static void simple_string(void) { int i; struct { const char *encoded; const char *decoded; } test_cases[] = { { "\"hello world\"", "hello world" }, { "\"the quick brown fox jumped over the fence\"", "the quick brown fox jumped over the fence" }, {} }; for (i = 0; test_cases[i].encoded; i++) { QObject *obj; QString *st...
18,574
1
static void spr_write_tbu(DisasContext *ctx, int sprn, int gprn) { if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } gen_helper_store_tbu(cpu_env, cpu_gpr[gprn]); if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_end(); gen_stop_exception(ctx); } }
18,575
1
static int decode_block(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) { EXRContext *s = avctx->priv_data; AVFrame *const p = s->picture; EXRThreadData *td = &s->thread_data[threadnr]; const uint8_t *channel_buffer[4] = { 0 }; const uint8_t *buf = s->buf; uint64_t line_offset, uncompressed_size; uint16_t ...
18,576
1
void watchdog_pc_init(PCIBus *pci_bus) { if (watchdog) watchdog->wdt_pc_init(pci_bus); }
18,577
1
static void copy_bits(PutBitContext *pb, const uint8_t *data, int size, GetBitContext *gb, int nbits) { int rmn_bytes, rmn_bits; rmn_bits = rmn_bytes = get_bits_left(gb); if (rmn_bits < nbits) rmn_bits &= 7; rmn_bytes >>= 3; if ((rmn_bits = FFMIN(rmn_bits, nbits)) > 0) put_bits(pb, rmn_bits, get_bits(gb, rmn_bits)); ff...
18,579
0
int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt) { ASFContext *asf = s->priv_data; ASFStream *asf_st = 0; for (;;) { if(url_feof(pb)) return AVERROR_EOF; if (asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1) { //asf->packet_size_left <= asf->packet_padsize) { int ret = ...
18,581
0
static int xmv_read_close(AVFormatContext *s) { XMVDemuxContext *xmv = s->priv_data; av_free(xmv->audio); av_free(xmv->audio_tracks); return 0; }
18,582
0
static void mpeg1_encode_sequence_header(MpegEncContext *s) { unsigned int vbv_buffer_size; unsigned int fps, v; int i; uint64_t time_code; float best_aspect_error= 1E10; float aspect_ratio= av_q2d(s->avctx->sample_aspect_ratio); int constraint_parameter_flag; if(aspect_ratio==0.0) aspect_ratio= 1.0; //pixel aspect 1:1...
18,584
0
int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; VP56Context *s = avctx->priv_data; AVFrame *const p = s->frames[VP56_FRAME_CURRENT]; int remaining_buf_size = avpkt->size; int av_uninit(alpha_offset); int i, res; if (s->has_alpha) { if (rem...
18,585
0
static int vfio_get_device(VFIOGroup *group, const char *name, VFIOPCIDevice *vdev) { struct vfio_device_info dev_info = { .argsz = sizeof(dev_info) }; struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) }; struct vfio_irq_info irq_info = { .argsz = sizeof(irq_info) }; int ret, i; ret = ioctl(group->fd, VFIO...
18,586
0
static void css_inject_io_interrupt(SubchDev *sch) { S390CPU *cpu = s390_cpu_addr2state(0); uint8_t isc = (sch->curr_status.pmcw.flags & PMCW_FLAGS_MASK_ISC) >> 11; trace_css_io_interrupt(sch->cssid, sch->ssid, sch->schid, sch->curr_status.pmcw.intparm, isc, ""); s390_io_interrupt(cpu, css_build_subchannel_id(sch), sch...
18,587
0
static int bonito_initfn(PCIDevice *dev) { PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev); /* Bonito North Bridge, built on FPGA, VENDOR_ID/DEVICE_ID are "undefined" */ pci_config_set_vendor_id(dev->config, 0xdf53); pci_config_set_device_id(dev->config, 0x00d5); pci_config_set_class(dev->config, PCI_CLASS_BRID...
18,588
0
static void decode_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch) { int32_t offset; int rs, rt, rd, sa; uint32_t op, op1, op2; int16_t imm; /* make sure instructions are on a word boundary */ if (ctx->pc & 0x3) { env->CP0_BadVAddr = ctx->pc; generate_exception(ctx, EXCP_AdEL); return; } /* Handle blikely no...
18,589
0
static void stream_complete(BlockJob *job, void *opaque) { StreamBlockJob *s = container_of(job, StreamBlockJob, common); StreamCompleteData *data = opaque; BlockDriverState *bs = blk_bs(job->blk); BlockDriverState *base = s->base; Error *local_err = NULL; if (!block_job_is_cancelled(&s->common) && data->reached_end &&...
18,590
0
static void img_snapshot(int argc, char **argv) { BlockDriverState *bs; QEMUSnapshotInfo sn; char *filename, *snapshot_name = NULL; int c, ret; int action = 0; qemu_timeval tv; /* Parse commandline parameters */ for(;;) { c = getopt(argc, argv, "la:c:d:h"); if (c == -1) break; switch(c) { case 'h': help(); return; case...
18,591
0
static void pack_yuv(TiffEncoderContext * s, uint8_t * dst, int lnum) { AVFrame *p = &s->picture; int i, j, k; int w = (s->width - 1) / s->subsampling[0] + 1; uint8_t *pu = &p->data[1][lnum / s->subsampling[1] * p->linesize[1]]; uint8_t *pv = &p->data[2][lnum / s->subsampling[1] * p->linesize[2]]; for (i = 0; i < w; i+...
18,592
0
static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, long dstW, long chrDstW) { #if COMPILE_TEMPL...
18,593
0
static void do_svc_interrupt(CPUS390XState *env) { uint64_t mask, addr; LowCore *lowcore; hwaddr len = TARGET_PAGE_SIZE; lowcore = cpu_physical_memory_map(env->psa, &len, 1); lowcore->svc_code = cpu_to_be16(env->int_svc_code); lowcore->svc_ilen = cpu_to_be16(env->int_svc_ilen); lowcore->svc_old_psw.mask = cpu_to_be64(g...
18,594
0
void qmp_blockdev_snapshot_sync(bool has_device, const char *device, bool has_node_name, const char *node_name, const char *snapshot_file, bool has_snapshot_node_name, const char *snapshot_node_name, bool has_format, const char *format, bool has_mode, NewImageMode mode, Error **errp) { BlockdevSnapshotSync snapshot = {...
18,595
0
void *address_space_map(AddressSpace *as, hwaddr addr, hwaddr *plen, bool is_write) { AddressSpaceDispatch *d = as->dispatch; hwaddr len = *plen; hwaddr todo = 0; int l; hwaddr page; MemoryRegionSection *section; ram_addr_t raddr = RAM_ADDR_MAX; ram_addr_t rlen; void *ret; while (len > 0) { page = addr & TARGET_PAGE_MA...
18,599
0
static void g364fb_ctrl_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned int size) { G364State *s = opaque; trace_g364fb_write(addr, val); if (addr >= REG_CLR_PAL && addr < REG_CLR_PAL + 0x800) { /* color palette */ int idx = (addr - REG_CLR_PAL) >> 3; s->color_palette[idx][0] = (val >> 16) & 0xff; s...
18,600
0
int kvm_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int type) { switch (type) { case GDB_BREAKPOINT_HW: len = 1; break; case GDB_WATCHPOINT_WRITE: case GDB_WATCHPOINT_ACCESS: switch (len) { case 1: break; case 2: case 4: case 8: if (addr & (len - 1)) return -EINVAL; break; default: return -EINVAL; } ...
18,601
0
void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque) { int i, found; WaitObjects *w = &wait_objects; found = 0; for (i = 0; i < w->num; i++) { if (w->events[i] == handle) found = 1; if (found) { w->events[i] = w->events[i + 1]; w->func[i] = w->func[i + 1]; w->opaque[i] = w->opaque[i + 1]; } } if...
18,602
0
static void vc1_interp_mc(VC1Context *v) { MpegEncContext *s = &v->s; DSPContext *dsp = &v->s.dsp; 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; if (!v->field_mod...
18,604
0
static void s390_msi_ctrl_write(void *opaque, hwaddr addr, uint64_t data, unsigned int size) { S390PCIBusDevice *pbdev; uint32_t io_int_word; uint32_t fid = data >> ZPCI_MSI_VEC_BITS; uint32_t vec = data & ZPCI_MSI_VEC_MASK; uint64_t ind_bit; uint32_t sum_bit; uint32_t e = 0; DPRINTF("write_msix data 0x%" PRIx64 " fid ...
18,605
0
static int qcow2_create2(const char *filename, int64_t total_size, const char *backing_file, const char *backing_format, int flags, size_t cluster_size, int prealloc, QEMUOptionParameter *options) { /* Calculate cluster_bits */ int cluster_bits; cluster_bits = ffs(cluster_size) - 1; if (cluster_bits < MIN_CLUSTER_BITS ...
18,606
0
static int virtio_mmio_set_guest_notifier(DeviceState *d, int n, bool assign, bool with_irqfd) { VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d); VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev); VirtQueue *vq = virtio_get_queue(vdev, n); EventNotifier *notifier = ...
18,607
0
static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVVHDXState *s = bs->opaque; int ret = 0; uint32_t i; uint64_t signature; uint32_t data_blocks_cnt, bitmap_blocks_cnt; s->bat = NULL; s->first_visible_write = true; qemu_co_mutex_init(&s->lock); /* validate the file signature */ ret...
18,608
0
void pci_register_bar(PCIDevice *pci_dev, int region_num, pcibus_t size, int type, PCIMapIORegionFunc *map_func) { PCIIORegion *r; uint32_t addr; uint64_t wmask; if ((unsigned int)region_num >= PCI_NUM_REGIONS) return; if (size & (size-1)) { fprintf(stderr, "ERROR: PCI region size must be pow2 " "type=0x%x, size=0x%"FM...
18,609
0
static void loadvm_postcopy_handle_run_bh(void *opaque) { Error *local_err = NULL; HandleRunBhData *data = opaque; /* TODO we should move all of this lot into postcopy_ram.c or a shared code * in migration.c */ cpu_synchronize_all_post_init(); qemu_announce_self(); /* Make sure all file formats flush their mutable meta...
18,610
0
BlockAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, void *opaque) { trace_bdrv_aio_writev(bs, sector_num, nb_sectors, opaque); return bdrv_co_aio_rw_vector(bs, sector_num, qiov, nb_sectors, 0, cb, opaque, true); }
18,611
0
void HELPER(srstu)(CPUS390XState *env, uint32_t r1, uint32_t r2) { uintptr_t ra = GETPC(); uint32_t len; uint16_t v, c = env->regs[0]; uint64_t end, str, adj_end; /* Bits 32-47 of R0 must be zero. */ if (env->regs[0] & 0xffff0000u) { cpu_restore_state(ENV_GET_CPU(env), ra); program_interrupt(env, PGM_SPECIFICATION, 6);...
18,612
0
static void scsi_aio_complete(void *opaque, int ret) { SCSIDiskReq *r = (SCSIDiskReq *)opaque; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); assert(r->req.aiocb != NULL); r->req.aiocb = NULL; block_acct_done(bdrv_get_stats(s->qdev.conf.bs), &r->acct); if (r->req.io_canceled) { scsi_req_cancel_complete(...
18,616
0
static void set_mem_path(Object *o, const char *str, Error **errp) { HostMemoryBackend *backend = MEMORY_BACKEND(o); HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o); if (memory_region_size(&backend->mr)) { error_setg(errp, "cannot change property value"); return; } if (fb->mem_path) { g_free(fb->mem_path); } fb->mem...
18,617
0
static always_inline void gen_store_mem (DisasContext *ctx, void (*tcg_gen_qemu_store)(TCGv t0, TCGv t1, int flags), int ra, int rb, int32_t disp16, int fp, int clear, int local) { TCGv addr; if (local) addr = tcg_temp_local_new(TCG_TYPE_I64); else addr = tcg_temp_new(TCG_TYPE_I64); if (rb != 31) { tcg_gen_addi_i64(add...
18,618
1
static int print_uint16(DeviceState *dev, Property *prop, char *dest, size_t len) { uint16_t *ptr = qdev_get_prop_ptr(dev, prop); return snprintf(dest, len, "%" PRIu16, *ptr); }
18,622
1
static int get_sot(Jpeg2000DecoderContext *s, int n) { Jpeg2000TilePart *tp; uint16_t Isot; uint32_t Psot; uint8_t TPsot; if (bytestream2_get_bytes_left(&s->g) < 8) Isot = bytestream2_get_be16u(&s->g); // Isot if (Isot) { avpriv_request_sample(s->avctx, "Support for more than one tile"); return AVERROR_PATCHWELCOME; } ...
18,623
1
static int cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) { int sx = 0, sy = 0; int dx = 0, dy = 0; int depth = 0; int notify = 0; /* make sure to only copy if it's a plain copy ROP */ if (*s->cirrus_rop == cirrus_bitblt_rop_fwd_src || *s->cirrus_rop == cirrus_bitblt_rop_bkwd_src) { int width, height...
18,625
1
static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) { AResampleContext *aresample = inlink->dst->priv; const int n_in = insamplesref->audio->nb_samples; int n_out = FFMAX(n_in * aresample->ratio * 2, 1); AVFilterLink *const outlink = inlink->dst->outputs[0]; AVFilterBufferRef *outsamplesref...
18,626
0
static int decode_subframe_lpc(FLACContext *s, int channel, int pred_order) { int sum, i, j; int coeff_prec, qlevel; int coeffs[pred_order]; // av_log(s->avctx, AV_LOG_DEBUG, " SUBFRAME LPC\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+...
18,628
0
static int compare_floats(const float *a, const float *b, int len, float max_diff) { int i; for (i = 0; i < len; i++) { if (fabsf(a[i] - b[i]) > max_diff) { av_log(NULL, AV_LOG_ERROR, "%d: %- .12f - %- .12f = % .12g\n", i, a[i], b[i], a[i] - b[i]); return -1; } } return 0; }
18,630
1
static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) { MTVDemuxContext *mtv = s->priv_data; ByteIOContext *pb = s->pb; int ret; #if !HAVE_BIGENDIAN int i; #endif if((url_ftell(pb) - s->data_offset + mtv->img_segment_size) % mtv->full_segment_size) { url_fskip(pb, MTV_AUDIO_PADDING_SIZE); ret = av_get_packet(pb...
18,631