project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | 82f19afefe4f28db0e2eefbc2d06eee0def74a53 | 0 | static int parse_tag(AVFormatContext *s, const uint8_t *buf)
{
int genre;
if (!(buf[0] == 'T' &&
buf[1] == 'A' &&
buf[2] == 'G'))
return -1;
get_string(s, "title", buf + 3, 30);
get_string(s, "artist", buf + 33, 30);
get_string(s, "album", buf + 63, 30);
... | 18,752 |
qemu | 6baebed7698a37a0ac5168faf26023426b0ac940 | 1 | static void vnc_update(VncState *vs, int x, int y, int w, int h)
{
int i;
h += y;
/* round x down to ensure the loop only spans one 16-pixel block per,
iteration. otherwise, if (x % 16) != 0, the last iteration may span
two 16-pixel blocks but we only mark the first as dirty
*/... | 18,754 |
qemu | 2c993ec294893af31deed27e5d79610ce71642e1 | 1 | int qemu_ftruncate64(int fd, int64_t length)
{
LARGE_INTEGER li;
LONG high;
HANDLE h;
BOOL res;
if ((GetVersion() & 0x80000000UL) && (length >> 32) != 0)
return -1;
h = (HANDLE)_get_osfhandle(fd);
/* get current position, ftruncate do not change position */
li.HighPart =... | 18,755 |
qemu | e0dadc1e9ef1f35208e5d2af9c7740c18a0b769f | 1 | I2CBus *aux_get_i2c_bus(AUXBus *bus)
{
return aux_bridge_get_i2c_bus(bus->bridge);
}
| 18,757 |
FFmpeg | 276df9d8210121f6d59b7876e1724ebe7a11f5e5 | 1 | static void lame_window_init(AacPsyContext *ctx, AVCodecContext *avctx) {
int i;
for (i = 0; i < avctx->channels; i++) {
AacPsyChannel *pch = &ctx->ch[i];
if (avctx->flags & CODEC_FLAG_QSCALE)
pch->attack_threshold = psy_vbr_map[avctx->global_quality / FF_QP2LAMBDA].st_lrm;
... | 18,758 |
qemu | e4f4fb1eca795e36f363b4647724221e774523c1 | 1 | static void pflash_cfi01_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = pflash_cfi01_realize;
dc->props = pflash_cfi01_properties;
dc->vmsd = &vmstate_pflash;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
} | 18,760 |
FFmpeg | 8c2515bbb9800a3cdcc28aa19133302ba5f2da45 | 1 | static void mc_block(uint8_t *dst, uint8_t *src, uint8_t *tmp, int stride, int b_w, int b_h, int dx, int dy){
int x, y;
START_TIMER
for(y=0; y < b_h+5; y++){
for(x=0; x < b_w; x++){
int a0= src[x ];
int a1= src[x + 1];
int a2= src[x + 2];
int a3... | 18,761 |
qemu | 405a27640b33c31ccef4001b3f3936b8c9d2218f | 1 | static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs,
int64_t sector_num,
QEMUIOVector *qiov,
int nb_sectors,
BlockDriverCompletionFunc *cb,
... | 18,762 |
FFmpeg | e3d2500fe498289a878b956f6efb4995438c9515 | 1 | static inline void RENAME(initFilter)(int16_t *filter, int16_t *filterPos, int *filterSize, int xInc,
int srcW, int dstW, int filterAlign, int one)
{
int i;
#ifdef HAVE_MMX
asm volatile("emms\n\t"::: "memory"); //FIXME this shouldnt be required but it IS (even for non mmx versions)
#endif
if(ABS(... | 18,763 |
FFmpeg | a736eb4a605f46d5ff96c7b32e55710ecd9cce89 | 1 | static void latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
{
LATMContext *ctx = s->priv_data;
AVCodecContext *avctx = s->streams[0]->codec;
GetBitContext gb;
int header_size;
/* AudioMuxElement */
put_bits(bs, 1, !!ctx->counter);
if (!ctx->counter) {
init... | 18,764 |
FFmpeg | b89f4fb1908f26d2704b9496952131fffd4dafae | 1 | static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
TM2Context * const l = avctx->priv_data;
AVFrame * const p= (AVFrame*)&l->pic;
int i, sk... | 18,765 |
FFmpeg | 28f9ab7029bd1a02f659995919f899f84ee7361b | 0 | static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int yend)
{
int x, y;
int *bounding_values= s->bounding_values_array+127;
int width = s->fragment_width[!!plane];
int height = s->fragment_height[!!plane];
int fragment = s->fragment_start ... | 18,767 |
FFmpeg | 69619a13c3fef940cba545cf0a283ff22771dd71 | 1 | static int matroska_probe(AVProbeData *p)
{
uint64_t total = 0;
int len_mask = 0x80, size = 1, n = 1, i;
/* EBML header? */
if (AV_RB32(p->buf) != EBML_ID_HEADER)
return 0;
/* length of header */
total = p->buf[4];
while (size <= 8 && !(total & len_mask)) {
size... | 18,768 |
FFmpeg | 7f526efd17973ec6d2204f7a47b6923e2be31363 | 1 | void palette8torgb32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette)
{
unsigned i;
/*
for(i=0; i<num_pixels; i++)
((unsigned *)dst)[i] = ((unsigned *)palette)[ src[i] ];
*/
for(i=0; i<num_pixels; i++)
{
#ifdef WORDS_BIGENDIAN
dst[3]= palette[ src[i]*4+2 ];
dst[2... | 18,769 |
qemu | 0426d53c6530606bf7641b83f2b755fe61c280ee | 1 | void visit_get_next_type(Visitor *v, int *obj, const int *qtypes,
const char *name, Error **errp)
{
if (v->get_next_type) {
v->get_next_type(v, obj, qtypes, name, errp);
}
}
| 18,770 |
qemu | 10eacda787ac9990dc22d4437b289200c819712c | 1 | static int bad_mode_switch(CPUARMState *env, int mode, CPSRWriteType write_type)
{
/* Return true if it is not valid for us to switch to
* this CPU mode (ie all the UNPREDICTABLE cases in
* the ARM ARM CPSRWriteByInstr pseudocode).
/* Changes to or from Hyp via MSR and CPS are illegal. */
... | 18,771 |
FFmpeg | fd34dbea58e097609ff09cf7dcc59f74930195d3 | 1 | static int mxf_read_source_clip(void *arg, AVIOContext *pb, int tag, int size, UID uid)
{
MXFStructuralComponent *source_clip = arg;
switch(tag) {
case 0x0202:
source_clip->duration = avio_rb64(pb);
break;
case 0x1201:
source_clip->start_position = avio_rb64(pb);
... | 18,772 |
FFmpeg | a956840cbcf89d709c4bd5980808ac0b5c8aeedf | 1 | static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time)
{
char buf[1024];
AVBPrint buf_script;
OutputStream *ost;
AVFormatContext *oc;
int64_t total_size;
AVCodecContext *enc;
int frame_number, vid, i;
double bitrate;
double speed;
int64_t p... | 18,774 |
qemu | 9897e462645fb8d91a4cef2a1ea3a74cc9149c13 | 1 | static int htab_load(QEMUFile *f, void *opaque, int version_id)
{
sPAPRMachineState *spapr = opaque;
uint32_t section_hdr;
int fd = -1;
if (version_id < 1 || version_id > 1) {
error_report("htab_load() bad version");
return -EINVAL;
}
section_hdr = qemu_get_be32(f);
... | 18,775 |
FFmpeg | 753074721bd414874d18c372c491bdc6323fa3bf | 0 | static av_cold void dump_enc_cfg(AVCodecContext *avctx,
const struct vpx_codec_enc_cfg *cfg)
{
int width = -30;
int level = AV_LOG_DEBUG;
av_log(avctx, level, "vpx_codec_enc_cfg\n");
av_log(avctx, level, "generic settings\n"
" %*s%u\n %*s%u\n %*s%u... | 18,777 |
FFmpeg | b754978a3b0aa17e7794f64c69bf4491762797fd | 0 | static int mpegps_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
AVStream *st;
int len, startcode, i, type, codec_id;
int64_t pts, dts;
redo:
len = mpegps_read_pes_header(s, NULL, &startcode, &pts, &dts, 1);
if (len < 0)
return len;
/* n... | 18,778 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static void get_downmix_coeffs(AC3DecodeContext *ctx)
{
int from = ctx->bsi.acmod;
int to = ctx->output;
float clev = clevs[ctx->bsi.cmixlev];
float slev = slevs[ctx->bsi.surmixlev];
ac3_audio_block *ab = &ctx->audio_block;
if (to == AC3_OUTPUT_UNMODIFIED)
return 0;
swit... | 18,779 |
FFmpeg | 659d4ba5af5d72716ee370bb367c741bd15e75b4 | 0 | static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
int mm_flags)
{
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
#if HAVE_INLINE_ASM
c->put_pixels_clamped = ff_put_pixels_clamped_mmx;
c->put_signed_pixels_clamped = ff_p... | 18,780 |
qemu | 273a2142176098fe2c27f263d86ad66b133b43cb | 0 | static int pci_nic_uninit(PCIDevice *dev)
{
PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, dev);
EEPRO100State *s = &d->eepro100;
cpu_unregister_io_memory(s->mmio_index);
return 0;
}
| 18,782 |
qemu | b9bec74bcb16519a876ec21cd5277c526a9b512d | 0 | static int kvm_getput_regs(CPUState *env, int set)
{
struct kvm_regs regs;
int ret = 0;
if (!set) {
ret = kvm_vcpu_ioctl(env, KVM_GET_REGS, ®s);
if (ret < 0)
return ret;
}
kvm_getput_reg(®s.rax, &env->regs[R_EAX], set);
kvm_getput_reg(®s.rbx, &e... | 18,783 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void visitor_reset(TestOutputVisitorData *data)
{
visitor_output_teardown(data, NULL);
visitor_output_setup(data, NULL);
}
| 18,784 |
qemu | 8bd7f71d794b93ce027b856f5b79a98f4f82e44c | 0 | static int qemu_reset_requested(void)
{
int r = reset_requested;
reset_requested = 0;
return r;
}
| 18,785 |
qemu | 83479e770d31e171232a82f4eee7dab06d3b219c | 0 | void cpu_interrupt(CPUState *s)
{
s->interrupt_request = 1;
}
| 18,786 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | static void test_io_channel_setup_async(SocketAddressLegacy *listen_addr,
SocketAddressLegacy *connect_addr,
QIOChannel **src,
QIOChannel **dst)
{
QIOChannelSocket *lioc;
struct TestIOCh... | 18,787 |
qemu | 245f7b51c0ea04fb2224b1127430a096c91aee70 | 0 | static int send_palette_rect(VncState *vs, int w, int h, struct QDict *palette)
{
int stream = 2;
int level = tight_conf[vs->tight_compression].idx_zlib_level;
int colors;
size_t bytes;
colors = qdict_size(palette);
vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLICIT_FILTER) << 4);
vnc... | 18,788 |
qemu | 47d3df2387ed6927732584ffa4159c26d9f4dee8 | 0 | static inline ioreq_t *xen_vcpu_ioreq(shared_iopage_t *shared_page, int vcpu)
{
return &shared_page->vcpu_iodata[vcpu].vp_ioreq;
}
| 18,789 |
qemu | 026aeffcb4752054830ba203020ed6eb05bcaba8 | 0 | static void cirrus_bitblt_fill_nop(CirrusVGAState *s,
uint8_t *dst,
int dstpitch, int bltwidth,int bltheight)
{
}
| 18,790 |
FFmpeg | 3176217c60ca7828712985092d9102d331ea4f3d | 0 | static int copy_parameter_set(void **to, void **from, int count, int size)
{
int i;
for (i = 0; i < count; i++) {
if (to[i] && !from[i]) {
av_freep(&to[i]);
} else if (from[i] && !to[i]) {
to[i] = av_malloc(size);
if (!to[i])
return ... | 18,791 |
qemu | 9e41bade85ef338afd983c109368d1bbbe931f80 | 0 | static int i2c_slave_qdev_init(DeviceState *dev)
{
I2CSlave *s = I2C_SLAVE(dev);
I2CSlaveClass *sc = I2C_SLAVE_GET_CLASS(s);
return sc->init(s);
}
| 18,792 |
qemu | dd4d607e40dcd2cb7646b510504880a70939d91b | 0 | static void vtd_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n)
{
VTDAddressSpace *vtd_as = container_of(mr, VTDAddressSpace, iommu);
IntelIOMMUState *s = vtd_as->iommu_state;
uint8_t bus_n = pci_bus_num(vtd_as->bus);
VTDContextEntry ce;
if (vtd_dev_to_context_entry(s, bus_n, vtd_as->devfn,... | 18,793 |
qemu | 710aec915d208246891b68e2ba61b54951edc508 | 0 | static void monitor_protocol_emitter(Monitor *mon, QObject *data,
QError *err)
{
QDict *qmp;
trace_monitor_protocol_emitter(mon);
if (!err) {
/* success response */
qmp = qdict_new();
if (data) {
qobject_incref(data);
... | 18,794 |
qemu | 428c3ece97179557f2753071fb0ca97a03437267 | 0 | static int msi_msix_setup(XenPCIPassthroughState *s,
uint64_t addr,
uint32_t data,
int *ppirq,
bool is_msix,
int msix_entry,
bool is_not_mapped)
{
uint8... | 18,796 |
qemu | 0cd09c3a6cc2230ba38c462fc410b4acce59eb6f | 0 | void virtio_net_set_config_size(VirtIONet *n, uint32_t host_features)
{
int i, config_size = 0;
host_features |= (1 << VIRTIO_NET_F_MAC);
for (i = 0; feature_sizes[i].flags != 0; i++) {
if (host_features & feature_sizes[i].flags) {
config_size = MAX(feature_sizes[i].end, config_siz... | 18,797 |
qemu | 4d43d3f3c8147ade184df9a1e9e82826edd39e19 | 0 | static void virtio_pci_vmstate_change(DeviceState *d, bool running)
{
VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
if (running) {
/* Try to find out if the guest has bus master disabled, but is
in ready state. Then we hav... | 18,798 |
qemu | ef0e64a9838c0a20b5cb8a0bd2dcbcc59b0b812d | 0 | static void ide_dma_cb(void *opaque, int ret)
{
IDEState *s = opaque;
int n;
int64_t sector_num;
uint64_t offset;
bool stay_active = false;
if (ret == -ECANCELED) {
return;
}
if (ret < 0) {
if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) {... | 18,800 |
qemu | 10c4c98ab7dc18169b37b76f6ea5e60ebe65222b | 0 | SSIBus *ssi_create_bus(DeviceState *parent, const char *name)
{
BusState *bus;
bus = qbus_create(BUS_TYPE_SSI, sizeof(SSIBus), parent, name);
return FROM_QBUS(SSIBus, bus);
}
| 18,801 |
FFmpeg | b1ade3d1821a29174963b28cd0caa5f7ed394998 | 0 | int ff_celp_lp_synthesis_filter(int16_t *out,
const int16_t* filter_coeffs,
const int16_t* in,
int buffer_length,
int filter_length,
int stop_on_overflow,
... | 18,802 |
FFmpeg | 65b83ce01b94eae944290c11257799a9288f2d4c | 0 | ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
AVStream *st, RMStream *ast, int len, AVPacket *pkt,
int *seq, int flags, int64_t timestamp)
{
RMDemuxContext *rm = s->priv_data;
int ret;
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
rm->... | 18,803 |
FFmpeg | 114315994bc08812eeef51eaace455d86b5098d5 | 0 | static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
{
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
GetBitContext *gb = &ctx->gb;
unsigned int k;
unsigned int s[8];
unsigned int sx[8];
unsigned int sub_blocks, log2_sub_blocks, ... | 18,804 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(yuv2packed1)(SwsContext *c, const uint16_t *buf0, const uint16_t *uvbuf0, const uint16_t *uvbuf1,
const uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, enum PixelFormat dstFormat, int flags, int y)
{
const int yalpha1=0;
int i;
const uint16_t... | 18,805 |
FFmpeg | 77cb22fa7b3f632c16aa3d4e7aa7d47f9cd99f2c | 0 | static int flic_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
FlicDemuxContext *flic = s->priv_data;
ByteIOContext *pb = &s->pb;
unsigned char header[FLIC_HEADER_SIZE];
AVStream *st;
int speed;
int magic_number;
flic->pts = 0;
/* load... | 18,807 |
FFmpeg | e87190f5d20d380608f792ceb14d0def1d80e24b | 0 | static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
{
char val_str[128];
int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;
writer_print_section_header(w, SECTION_ID_FORMAT);
print_str("filename", fmt_ctx->filename);
print_int("nb_streams", fmt_ctx->nb_st... | 18,808 |
FFmpeg | 150ddbc1482c65b9aac803f011d7fcd734f776ec | 0 | static void flush_encoders(OutputStream *ost_table, int nb_ostreams)
{
int i, ret;
for (i = 0; i < nb_ostreams; i++) {
OutputStream *ost = &ost_table[i];
AVCodecContext *enc = ost->st->codec;
AVFormatContext *os = output_files[ost->file_index].ctx;
if (!ost->encoding... | 18,809 |
FFmpeg | 5dc47a2bd52e375ed742c45d08356b45098f458d | 0 | static int mkv_write_chapters(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
AVIOContext *pb = s->pb;
ebml_master chapters, editionentry;
AVRational scale = {1, 1E9};
int i, ret;
if (!s->nb_chapters || mkv->wrote_chapters)
return 0;
ret = mkv_add_seekhead_... | 18,810 |
qemu | cd6a9bb6e977864b1b7ec21b983fa0678b4b82e9 | 1 | static uint64_t ppc_hash64_page_shift(ppc_slb_t *slb)
{
uint64_t epnshift;
/* Page size according to the SLB, which we use to generate the
* EPN for hash table lookup.. When we implement more recent MMU
* extensions this might be different from the actual page size
* encoded in the PTE *... | 18,811 |
FFmpeg | 9a54c6f243412f62bae498ddcac337cb18ae6290 | 1 | static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
int jobnr, int threadnr, int is_vp7)
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *td = &s->thread_data[threadnr];
int mb_x, mb_y = td->thread_mb_pos >> 16, num_jobs = s->num_jobs;
AVF... | 18,813 |
FFmpeg | e5c01ccdf5a9a330d4c51a9b9ea721fd8f1fb70b | 0 | static int decode_frame(FLACContext *s)
{
int i, ret;
GetBitContext *gb = &s->gb;
FLACFrameInfo fi;
if ((ret = ff_flac_decode_frame_header(s->avctx, gb, &fi, 0)) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "invalid frame header\n");
return ret;
}
if (s->channels && fi.chan... | 18,815 |
qemu | aec4b054ea36c53c8b887da99f20010133b84378 | 1 | static void invalid_array_comma(void)
{
QObject *obj = qobject_from_json("[32,}", NULL);
g_assert(obj == NULL);
}
| 18,816 |
qemu | c508277335e3b6b20cf18e6ea3a35c1fa835c64a | 1 | static void vmxnet3_ack_events(VMXNET3State *s, uint32_t val)
{
uint32_t events;
VMW_CBPRN("Clearing events: 0x%x", val);
events = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, ecr) & ~val;
VMXNET3_WRITE_DRV_SHARED32(s->drv_shmem, ecr, events);
}
| 18,817 |
qemu | 9d5614d582d23ec96b167583557bf3f25f64f050 | 1 | static void grlib_gptimer_enable(GPTimer *timer)
{
assert(timer != NULL);
ptimer_stop(timer->ptimer);
if (!(timer->config & GPTIMER_ENABLE)) {
/* Timer disabled */
trace_grlib_gptimer_disabled(timer->id, timer->config);
return;
}
/* ptimer is triggered when t... | 18,818 |
FFmpeg | 46191a2da16f751e53d93646ae1388d421d12bee | 1 | static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len,
char *dst, int dstlen)
{
char *p = dst;
char *end = dst+dstlen-1;
int i;
for (i = 0; i < len; i++) {
uint8_t t, c = avio_r8(pb);
if (c < 0x80 && p < end)
*p++ = c... | 18,821 |
FFmpeg | 428098165de4c3edfe42c1b7f00627d287015863 | 1 | altivec_yuv2packedX (SwsContext *c,
int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, int dstW, int dstY)
{
int i,j;
vector signed short X,X0,X1,Y0,U0,V0,Y1,U1,V1,U,V;
vector signed short R0,G0,B0,R1,G... | 18,822 |
qemu | a2f31f180499593b5edb8ac5ab8ac1b92f0abcd4 | 1 | int unix_listen_opts(QemuOpts *opts, Error **errp)
{
struct sockaddr_un un;
const char *path = qemu_opt_get(opts, "path");
int sock, fd;
sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
if (sock < 0) {
error_setg_errno(errp, errno, "Failed to create Unix socket");
return -1;
... | 18,823 |
FFmpeg | 3ab9a2a5577d445252724af4067d2a7c8a378efa | 1 | static void rv40_h_strong_loop_filter(uint8_t *src, const int stride,
const int alpha, const int lims,
const int dmode, const int chroma)
{
rv40_strong_loop_filter(src, stride, 1, alpha, lims, dmode, chroma);
}
| 18,824 |
FFmpeg | e6aed5f404a0983b2971c90e9022f6964a75de0b | 1 | static void copy_frame(J2kEncoderContext *s)
{
int tileno, compno, i, y, x;
uint8_t *line;
for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){
J2kTile *tile = s->tile + tileno;
if (s->planar){
for (compno = 0; compno < s->ncomponents; compno++){
... | 18,825 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static void migrate_fd_cleanup(void *opaque)
{
MigrationState *s = opaque;
qemu_bh_delete(s->cleanup_bh);
s->cleanup_bh = NULL;
if (s->file) {
trace_migrate_fd_cleanup();
qemu_mutex_unlock_iothread();
qemu_thread_join(&s->thread);
qemu_mutex_lock_iothread();
... | 18,826 |
qemu | f53c398aa603cea135ee58fd15249aeff7b9c7ea | 1 | static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev)
{
UHCIAsync *curr, *n;
QTAILQ_FOREACH_SAFE(curr, &s->async_pending, next, n) {
if (curr->packet.owner == NULL ||
curr->packet.owner->dev != dev) {
continue;
}
uhci_async_unlink(s, curr);
... | 18,827 |
qemu | 0b5538c300a56c3cfb33022840fe0b4968147e7a | 1 | static TraceEvent* find_trace_event_by_name(const char *tname)
{
unsigned int i;
if (!tname) {
return NULL;
}
for (i = 0; i < NR_TRACE_EVENTS; i++) {
if (!strcmp(trace_list[i].tp_name, tname)) {
return &trace_list[i];
}
}
return NULL; /* indicat... | 18,829 |
qemu | b0f74c87a1dbd6b0c5e4de7f1c5cb40197e3fbe9 | 1 | i2c_slave *twl92230_init(i2c_bus *bus, qemu_irq irq)
{
struct menelaus_s *s = (struct menelaus_s *)
i2c_slave_init(bus, 0, sizeof(struct menelaus_s));
s->i2c.event = menelaus_event;
s->i2c.recv = menelaus_rx;
s->i2c.send = menelaus_tx;
s->irq = irq;
s->rtc.hz = qemu_new_t... | 18,831 |
FFmpeg | aaec4e03e91f3f301d5720429a5da99b44e7e1bb | 0 | static int av_seek_frame_generic(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
int index;
AVStream *st;
AVIndexEntry *ie;
st = s->streams[stream_index];
index = av_index_search_timestamp(st, timestamp, flags);
if(index < 0 ||... | 18,832 |
FFmpeg | c1b24ca762cba20236190cd7b24e84a9ad788bcb | 1 | static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt)
{
struct ogg *ogg;
struct ogg_stream *os;
int idx, ret;
int pstart, psize;
int64_t fpos, pts, dts;
if (s->io_repositioned) {
ogg_reset(s);
s->io_repositioned = 0;
//Get an ogg packet
retry:
do ... | 18,835 |
qemu | df46189412567906312684eb72ba87c6a86a4cdb | 1 | static void slirp_cleanup(void)
{
WSACleanup();
}
| 18,836 |
FFmpeg | 27f6da292118850ca7900de64d06b56e0ebb5070 | 1 | static int read_sl_header(PESContext *pes, SLConfigDescr *sl,
const uint8_t *buf, int buf_size)
{
GetBitContext gb;
int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
int dts_flag = -1, cts_f... | 18,837 |
FFmpeg | 1f50baa2b2da7fdbfccf0662883f38a763ff6619 | 1 | static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
{
HEVCLocalContext *lc = s->HEVClc;
GetBitContext *gb = &lc->gb;
int ctb_addr_ts, ret;
*gb = nal->gb;
s->nal_unit_type = nal->type;
s->temporal_id = nal->temporal_id;
switch (s->nal_unit_type) {
... | 18,839 |
qemu | c5a49c63fa26e8825ad101dfe86339ae4c216539 | 1 | static bool gen_rsr_ccount(DisasContext *dc, TCGv_i32 d, uint32_t sr)
{
if (dc->tb->cflags & CF_USE_ICOUNT) {
gen_io_start();
}
gen_helper_update_ccount(cpu_env);
tcg_gen_mov_i32(d, cpu_SR[sr]);
if (dc->tb->cflags & CF_USE_ICOUNT) {
gen_io_end();
return true;
}
... | 18,840 |
FFmpeg | 86020073dbb9a3a9d1fbb76345b2ca29ba1f13d2 | 1 | static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
ADPCMDecodeContext *c = avctx->priv_data;
ADPCMChannelStatus *cs;
int n, m, channel, i;
shor... | 18,841 |
FFmpeg | b5228e44c7f3a5eba537c8a39a45cfbf2961a28d | 1 | static void noise_scale(int *coefs, int scale, int band_energy, int len)
{
int ssign = scale < 0 ? -1 : 1;
int s = FFABS(scale);
unsigned int round;
int i, out, c = exp2tab[s & 3];
int nlz = 0;
while (band_energy > 0x7fff) {
band_energy >>= 1;
nlz++;
}
c /= b... | 18,842 |
qemu | 88365d17d586bcf0d9f4432447db345f72278a2a | 1 | int kvm_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int type)
{
return -EINVAL;
}
| 18,843 |
qemu | b7b5233ad7fdd9985bb6d05b7919f3a20723ff2c | 1 | void *g_malloc(size_t size)
{
char * p;
size += 16;
p = bsd_vmalloc(size);
*(size_t *)p = size;
return p + 16;
}
| 18,844 |
FFmpeg | e24c31b656254b2516befbde78aeaca0122a6010 | 1 | int ff_dirac_golomb_read_16bit(DiracGolombLUT *lut_ctx, const uint8_t *buf,
int bytes, uint8_t *_dst, int coeffs)
{
int i, b, c_idx = 0;
int16_t *dst = (int16_t *)_dst;
DiracGolombLUT *future[4], *l = &lut_ctx[2*LUT_SIZE + buf[0]];
INIT_RESIDUE(res, 0, 0);
#define... | 18,845 |
qemu | 5f9490de566c5b092a6cfedc3c7a37a9c9dee917 | 1 | static void spapr_tce_table_finalize(Object *obj)
{
sPAPRTCETable *tcet = SPAPR_TCE_TABLE(obj);
QLIST_REMOVE(tcet, list);
if (!kvm_enabled() ||
(kvmppc_remove_spapr_tce(tcet->table, tcet->fd,
tcet->nb_table) != 0)) {
g_free(tcet->table);
}
}
| 18,846 |
FFmpeg | 8ef740ce01abff3bc7df0f79803a3dc781d89daa | 0 | int ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
{
uint8_t *src[4], *dst[4];
int i, j, vsub, ret;
int (*draw_slice)(AVFilterLink *, int, int, int);
FF_TPRINTF_START(NULL, draw_slice); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
/* c... | 18,847 |
qemu | 3a661f1eabf7e8db66e28489884d9b54aacb94ea | 1 | int qcrypto_cipher_encrypt(QCryptoCipher *cipher,
const void *in,
void *out,
size_t len,
Error **errp)
{
QCryptoCipherBuiltin *ctxt = cipher->opaque;
return ctxt->encrypt(cipher, in, out, len, errp); | 18,848 |
qemu | 448fe3c1349b540c66e048788dd98b9c80775c53 | 1 | static void e1000e_pci_foreach_callback(QPCIDevice *dev, int devfn, void *data)
{
*(QPCIDevice **) data = dev;
}
| 18,849 |
FFmpeg | aac07a7a4c2c7a4a29cf6dbc88c1b9fdd191b99d | 0 | static int rm_read_index(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
unsigned int size, n_pkts, str_id, next_off, n, pos, pts;
AVStream *st;
do {
if (avio_rl32(pb) != MKTAG('I','N','D','X'))
return -1;
size = avio_rb32(pb);
if (size < 20)
... | 18,850 |
FFmpeg | fd6768a4b8e2ce9e25a447aec9194b2bcdd1ac35 | 0 | int ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats, int stats_size, int skip0)
{
HeapElem *h = av_malloc_array(sizeof(*h), stats_size);
int *up = av_malloc_array(sizeof(*up) * 2, stats_size);
uint8_t *len = av_malloc_array(sizeof(*len) * 2, stats_size);
uint16_t *map= av_malloc_arr... | 18,851 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static int dec_scc_r(CPUCRISState *env, DisasContext *dc)
{
int cond = dc->op2;
LOG_DIS("s%s $r%u\n",
cc_name(cond), dc->op1);
if (cond != CC_A) {
int l1;
gen_tst_cc(dc, cpu_R[dc->op1], cond);
l1 = gen_new_label();
tcg_gen_brcondi_tl(TCG_COND_EQ, cp... | 18,854 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | static BlockAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
int64_t sector_num,
QEMUIOVector *qiov,
int nb_sectors,
BlockCompletionFunc *cb,
... | 18,855 |
qemu | 80f5ce758ac277e76c016dd7c0b246e40d4fca2d | 0 | static int elf_core_dump(int signr, const CPUState *env)
{
const TaskState *ts = (const TaskState *)env->opaque;
struct vm_area_struct *vma = NULL;
char corefile[PATH_MAX];
struct elf_note_info info;
struct elfhdr elf;
struct elf_phdr phdr;
struct rlimit dumpsize;
struct mm_stru... | 18,856 |
qemu | b931bfbf042983f311b3b09894d8030b2755a638 | 0 | int net_init_vhost_user(const NetClientOptions *opts, const char *name,
NetClientState *peer, Error **errp)
{
const NetdevVhostUserOptions *vhost_user_opts;
CharDriverState *chr;
assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER);
vhost_user_opts = opts->vhost_user;... | 18,857 |
qemu | 7e97cd88148876bad36ee7c66d526dcaed328d0d | 0 | static void *tcg_cpu_thread_fn(void *arg)
{
CPUState *env = arg;
qemu_tcg_init_cpu_signals();
qemu_thread_self(env->thread);
/* signal CPU creation */
qemu_mutex_lock(&qemu_global_mutex);
for (env = first_cpu; env != NULL; env = env->next_cpu)
env->created = 1;
qemu_cond... | 18,858 |
qemu | de9e9d9f17a36ff76c1a02a5348835e5e0a081b0 | 0 | static inline void gen_op_mulscc(TCGv dst, TCGv src1, TCGv src2)
{
TCGv r_temp, zero;
r_temp = tcg_temp_new();
/* old op:
if (!(env->y & 1))
T1 = 0;
*/
zero = tcg_const_tl(0);
tcg_gen_andi_tl(cpu_cc_src, src1, 0xffffffff);
tcg_gen_andi_tl(r_temp, cpu_y, 0x1);
t... | 18,859 |
FFmpeg | d0da310317cae25c0c533f6862fb25dc81ec3d4b | 0 | dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
IBaseFilter *device_filter, IPin **ppin)
{
IEnumPins *pins = 0;
IPin *device_pin = NULL;
IPin *pin;
int r;
const GUID *mediatype[2] = { &MEDIATYPE_Video, &MEDIATYPE_Audio };
const char *devtypename ... | 18,860 |
qemu | a03ef88f77af045a2eb9629b5ce774a3fb973c5e | 0 | static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs,
int64_t offset, int count, BdrvRequestFlags flags)
{
uint64_t reqid = request_id++;
int ret = bdrv_co_pwrite_zeroes(bs->file->bs, offset, count, flags);
block_request_create(reqid, bs, qemu_coroutine_self());
qemu_corouti... | 18,861 |
qemu | cea5f9a28faa528b6b1b117c9ab2d8828f473fef | 0 | static void tcg_target_qemu_prologue (TCGContext *s)
{
int i, frame_size;
#ifndef __APPLE__
uint64_t addr;
#endif
frame_size = 0
+ 8 /* back chain */
+ 8 /* CR */
+ 8 /* LR */
+ 8 /* c... | 18,862 |
qemu | 9f1963b3f72521f75a549f8afd61b19e7da63c6f | 0 | int blk_co_discard(BlockBackend *blk, int64_t sector_num, int nb_sectors)
{
int ret = blk_check_request(blk, sector_num, nb_sectors);
if (ret < 0) {
return ret;
}
return bdrv_co_discard(blk_bs(blk), sector_num, nb_sectors);
}
| 18,863 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | GList *range_list_insert(GList *list, Range *data)
{
GList *l;
/* Range lists require no empty ranges */
assert(data->begin < data->end || (data->begin && !data->end));
/* Skip all list elements strictly less than data */
for (l = list; l && range_compare(l->data, data) < 0; l = l->next) {... | 18,864 |
qemu | c39ce112b60ffafbaf700853e32bea74cbb2c148 | 0 | SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
void *hba_private)
{
return d->info->alloc_req(d, tag, lun, hba_private);
}
| 18,865 |
qemu | 185b43386ad999c80bdc58e41b87f05e5b3e8463 | 0 | static int nbd_send_negotiate(int csock, off_t size, uint32_t flags)
{
char buf[8 + 8 + 8 + 128];
/* Negotiate
[ 0 .. 7] passwd ("NBDMAGIC")
[ 8 .. 15] magic (0x00420281861253)
[16 .. 23] size
[24 .. 27] flags
[28 .. 151] reserved (0)
*... | 18,866 |
qemu | 91cda45b69e45a089f9989979a65db3f710c9925 | 0 | static int find_pte32(CPUPPCState *env, struct mmu_ctx_hash32 *ctx, int h,
int rw, int type, int target_page_bits)
{
hwaddr pteg_off;
target_ulong pte0, pte1;
int i, good = -1;
int ret, r;
ret = -1; /* No entry found */
pteg_off = get_pteg_offset32(env, ctx->hash[... | 18,867 |
qemu | 4d68e86bb10159099da0798f74e7512955f15eec | 0 | static void __attribute__((constructor)) coroutine_pool_init(void)
{
qemu_mutex_init(&pool_lock);
}
| 18,868 |
qemu | c2fa30757a2ba1bb5b053883773a9a61fbdd7082 | 0 | static void nvdimm_dsm_root(NvdimmDsmIn *in, hwaddr dsm_mem_addr)
{
/*
* function 0 is called to inquire which functions are supported by
* OSPM
*/
if (!in->function) {
nvdimm_dsm_function0(0 /* No function supported other than
function 0 */, dsm_... | 18,869 |
qemu | d76548a98f4e18d3c65a3d921bbb70caf9be6138 | 0 | static int spapr_phb_vfio_eeh_set_option(sPAPRPHBState *sphb,
unsigned int addr, int option)
{
sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb);
struct vfio_eeh_pe_op op = { .argsz = sizeof(op) };
int ret;
switch (option) {
case RTAS_EEH_D... | 18,870 |
FFmpeg | 3176217c60ca7828712985092d9102d331ea4f3d | 0 | static int vaapi_h264_start_frame(AVCodecContext *avctx,
av_unused const uint8_t *buffer,
av_unused uint32_t size)
{
H264Context * const h = avctx->priv_data;
struct vaapi_context * const vactx = avctx->hwaccel_context;
... | 18,871 |
qemu | b40acf99bef69fa8ab0f9092ff162fde945eec12 | 0 | void cpu_outb(pio_addr_t addr, uint8_t val)
{
LOG_IOPORT("outb: %04"FMT_pioaddr" %02"PRIx8"\n", addr, val);
trace_cpu_out(addr, val);
ioport_write(0, addr, val);
}
| 18,873 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.