project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 187337f8b0ec0813dd3876d1efe37d415fb81c2e | 1 | struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size,
DisplayState *ds, const char *revision)
{
struct pxa2xx_state_s *s;
struct pxa2xx_ssp_s *ssp;
int iomemtype, i;
s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s));
if (revision && strncmp(revi... | 10,958 |
qemu | e23a1b33b53d25510320b26d9f154e19c6c99725 | 1 | static void apc_init(target_phys_addr_t power_base, qemu_irq cpu_halt)
{
DeviceState *dev;
SysBusDevice *s;
dev = qdev_create(NULL, "apc");
qdev_init(dev);
s = sysbus_from_qdev(dev);
/* Power management (APC) XXX: not a Slavio device */
sysbus_mmio_map(s, 0, power_base);
sysbu... | 10,959 |
FFmpeg | 24ae353dfbe61019a86093a9c5cd15476aabef49 | 1 | static int wc3_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
Wc3DemuxContext *wc3 = s->priv_data;
ByteIOContext *pb = s->pb;
unsigned int fourcc_tag;
unsigned int size;
AVStream *st;
int ret = 0;
int current_palette = 0;
char *buffer;
... | 10,961 |
qemu | 7b5651605836fd29572fd4c8769af5378d351712 | 1 | struct icp_state *xics_system_init(int nr_irqs)
{
CPUPPCState *env;
CPUState *cpu;
int max_server_num;
struct icp_state *icp;
struct ics_state *ics;
max_server_num = -1;
for (env = first_cpu; env != NULL; env = env->next_cpu) {
cpu = CPU(ppc_env_get_cpu(env));
if ... | 10,963 |
qemu | 1ee24514aed34760fb2863d98bea3a1b705d9c9f | 1 | static uint16_t nvme_write_zeros(NvmeCtrl *n, NvmeNamespace *ns, NvmeCmd *cmd,
NvmeRequest *req)
{
NvmeRwCmd *rw = (NvmeRwCmd *)cmd;
const uint8_t lba_index = NVME_ID_NS_FLBAS_INDEX(ns->id_ns.flbas);
const uint8_t data_shift = ns->id_ns.lbaf[lba_index].ds;
uint64_t slba = le64_to_cpu(rw->slba)... | 10,966 |
FFmpeg | 67318187fbba382d887f9581dde48a50842f1bea | 1 | static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
AVPacket* avpkt)
{
WmallDecodeCtx *s = avctx->priv_data;
GetBitContext* gb = &s->pgb;
const uint8_t* buf = avpkt->data;
int buf_size = avpkt->size;
int num_bits_prev_frame, packet_sequence... | 10,967 |
qemu | c63807244fb55071675907460a0ecf228c1766c8 | 1 | int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size1)
{
int size, l;
if (f->is_write) {
abort();
}
size = size1;
while (size > 0) {
l = f->buf_size - f->buf_index;
if (l == 0) {
qemu_fill_buffer(f);
l = f->buf_size - f->buf_index;
... | 10,968 |
FFmpeg | fce88d52ca0b694a614e2cf030c3f622db65b164 | 1 | static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
{
AVIContext *avi = s->priv_data;
ByteIOContext *pb = s->pb;
int n, d[8], size;
offset_t i, sync;
void* dstr;
if (ENABLE_DV_DEMUXER && avi->dv_demux) {
size = dv_get_packet(avi->dv_demux, pkt);
if (size >= 0)
... | 10,969 |
qemu | ebb718a5c7240f6ffb308e0d0b67a92c3b63b91c | 1 | static bool is_zero_cluster_top_locked(BlockDriverState *bs, int64_t start)
{
BDRVQcow2State *s = bs->opaque;
int nr = s->cluster_sectors;
uint64_t off;
int ret;
ret = qcow2_get_cluster_offset(bs, start << BDRV_SECTOR_BITS, &nr, &off);
assert(nr == s->cluster_sectors);
return ret =... | 10,972 |
qemu | 0479097859372a760843ad1b9c6ed3705c6423ca | 1 | void spapr_lmb_release(DeviceState *dev)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_hotplug_handler(dev));
PCDIMMDevice *dimm = PC_DIMM(dev);
PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
MemoryRegion *mr = ddc->get_memory_region(dimm);
sPAPRDIMMState *ds = spapr_pending_dimm_unpl... | 10,973 |
qemu | a88ae0d44b6b5830b752641b2198735272f13eaf | 1 | static void pc_xen_hvm_init(MachineState *machine)
{
PCIBus *bus;
pc_xen_hvm_init_pci(machine);
bus = pci_find_primary_bus();
if (bus != NULL) {
pci_create_simple(bus, -1, "xen-platform"); | 10,975 |
qemu | f2ad97ff81da51c064b9e87720ff48a0874f45d4 | 1 | static int usb_xhci_post_load(void *opaque, int version_id)
{
XHCIState *xhci = opaque;
PCIDevice *pci_dev = PCI_DEVICE(xhci);
XHCISlot *slot;
XHCIEPContext *epctx;
dma_addr_t dcbaap, pctx;
uint32_t slot_ctx[4];
uint32_t ep_ctx[5];
int slotid, epid, state, intr;
dcbaap = ... | 10,976 |
qemu | 1beb99f787ba110a9de44254e7d62a1cb9117de8 | 0 | void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
MemoryRegion *parent)
{
ar->tmr.update_sci = update_sci;
ar->tmr.timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, acpi_pm_tmr_timer, ar);
memory_region_init_io(&ar->tmr.io, memory_region_owner(parent),
... | 10,977 |
qemu | f090c9d4ad5812fb92843d6470a1111c15190c4c | 0 | INLINE int16 extractFloat32Exp( float32 a )
{
return ( a>>23 ) & 0xFF;
}
| 10,978 |
qemu | ef76dc59fa5203d146a2acf85a0ad5a5971a4824 | 0 | START_TEST(simple_string)
{
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" },
{}
... | 10,979 |
FFmpeg | 3176217c60ca7828712985092d9102d331ea4f3d | 0 | int decode_luma_residual(const H264Context *h, H264SliceContext *sl,
GetBitContext *gb, const uint8_t *scan,
const uint8_t *scan8x8, int pixel_shift,
int mb_type, int cbp, int p)
{
int i4x4, i8x8;
int qscale = p == 0 ? sl->qscale :... | 10,980 |
FFmpeg | f748e3b5a219061db021d8b6b7ebb097c65f23c5 | 0 | static int get_codec_data(AVIOContext *pb, AVStream *vst,
AVStream *ast, int myth)
{
nuv_frametype frametype;
if (!vst && !myth)
return 1; // no codec data needed
while (!avio_feof(pb)) {
int size, subtype;
frametype = avio_r8(pb);
switc... | 10,981 |
qemu | 2ff64038a59e8de2baa485806be0838f49f70b79 | 0 | ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr,
ram_addr_t start)
{
unsigned long base = mr->ram_addr >> TARGET_PAGE_BITS;
unsigned long nr = base + (start >> TARGET_PAGE_BITS);
uint64_t mr_size = TARGET_PAGE_ALIGN(memory_region_size(m... | 10,983 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t unassigned_mem_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
#ifdef DEBUG_UNASSIGNED
printf("Unassigned mem read " TARGET_FMT_plx "\n", addr);
#endif
#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE)
cpu_una... | 10,985 |
qemu | 0e9b9edae7bebfd31fdbead4ccbbce03876a7edd | 0 | build_rsdt(GArray *table_data, GArray *linker, GArray *table_offsets,
const char *oem_id, const char *oem_table_id)
{
AcpiRsdtDescriptorRev1 *rsdt;
size_t rsdt_len;
int i;
const int table_data_len = (sizeof(uint32_t) * table_offsets->len);
rsdt_len = sizeof(*rsdt) + table_data_le... | 10,987 |
qemu | 5145b3d1cc4dc77d82086d99b0690a76e1073071 | 0 | static uint32_t pflash_read (pflash_t *pfl, target_phys_addr_t offset,
int width, int be)
{
target_phys_addr_t boff;
uint32_t ret;
uint8_t *p;
DPRINTF("%s: offset " TARGET_FMT_plx "\n", __func__, offset);
ret = -1;
if (pfl->rom_mode) {
/* Lazy rese... | 10,988 |
qemu | f22d85e9e67262db34504f4079745f9843da6a92 | 0 | static void disable_logging(void)
{
ga_disable_logging(ga_state);
}
| 10,989 |
qemu | 9456c2fbcd82dd82328ac6e7602a815582b1043e | 0 | int r4k_map_address (CPUMIPSState *env, hwaddr *physical, int *prot,
target_ulong address, int rw, int access_type)
{
uint8_t ASID = env->CP0_EntryHi & 0xFF;
int i;
for (i = 0; i < env->tlb->tlb_in_use; i++) {
r4k_tlb_t *tlb = &env->tlb->mmu.r4k.tlb[i];
/* 1k pa... | 10,990 |
qemu | 0e9b9edae7bebfd31fdbead4ccbbce03876a7edd | 0 | GArray *bios_linker_loader_init(void)
{
return g_array_new(false, true /* clear */, 1);
}
| 10,991 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void exynos4210_fimd_update(void *opaque)
{
Exynos4210fimdState *s = (Exynos4210fimdState *)opaque;
Exynos4210fimdWindow *w;
int i, line;
target_phys_addr_t fb_line_addr, inc_size;
int scrn_height;
int first_line = -1, last_line = -1, scrn_width;
bool blend = false;
uint8... | 10,993 |
qemu | 245f7b51c0ea04fb2224b1127430a096c91aee70 | 0 | static int find_large_solid_color_rect(VncState *vs, int x, int y,
int w, int h, int max_rows)
{
int dx, dy, dw, dh;
int n = 0;
/* Try to find large solid-color areas and send them separately. */
for (dy = y; dy < y + h; dy += VNC_TIGHT_MAX_SPLIT_TILE_SIZ... | 10,994 |
qemu | e1123a3b40a1a9a625a29c8ed4debb7e206ea690 | 0 | static void iscsi_allocationmap_clear(IscsiLun *iscsilun, int64_t sector_num,
int nb_sectors)
{
int64_t cluster_num, nb_clusters;
if (iscsilun->allocationmap == NULL) {
return;
}
cluster_num = DIV_ROUND_UP(sector_num, iscsilun->cluster_sectors);
... | 10,995 |
FFmpeg | dd561441b1e849df7d8681c6f32af82d4088dafd | 0 | static void h264_h_loop_filter_luma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
{
h264_loop_filter_luma_c(pix, 1, stride, alpha, beta, tc0);
}
| 10,996 |
FFmpeg | 9d599e3f6e61438772d8cddd6c9b7c495251f51e | 0 | static int avi_read_header(AVFormatContext *s)
{
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
unsigned int tag, tag1, handler;
int codec_type, stream_index, frame_period;
unsigned int size;
int i;
AVStream *st;
AVIStream *ast = NULL;
int avih_width = 0... | 10,997 |
qemu | 53cb28cbfea038f8ad50132dc8a684e638c7d48b | 0 | static void phys_page_set(AddressSpaceDispatch *d,
hwaddr index, hwaddr nb,
uint16_t leaf)
{
/* Wildly overreserve - it doesn't matter much. */
phys_map_node_reserve(3 * P_L2_LEVELS);
phys_page_set_level(&d->phys_map, &index, &nb, leaf, P_L2_LEVELS... | 10,998 |
FFmpeg | 6e8d4a7afbf40c0eb4bd70a6e7724d22ce7a6239 | 0 | static av_cold int g726_decode_init(AVCodecContext *avctx)
{
G726Context* c = avctx->priv_data;
if (avctx->sample_rate <= 0) {
av_log(avctx, AV_LOG_ERROR, "Samplerate is invalid\n");
return -1;
}
if(avctx->channels != 1){
av_log(avctx, AV_LOG_ERROR, "Only mono is supp... | 11,000 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint32_t isa_mmio_readw(void *opaque, target_phys_addr_t addr)
{
return cpu_inw(addr & IOPORTS_MASK);
}
| 11,001 |
qemu | b02ef3d92b19ad304a84433d3817f0903296ebc7 | 0 | static void unassign_storage(SCLPDevice *sclp, SCCB *sccb)
{
MemoryRegion *mr = NULL;
AssignStorage *assign_info = (AssignStorage *) sccb;
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
assert(mhd);
ram_addr_t unassign_addr = (assign_info->rn - 1) * mhd->rzm;
MemoryRegion *sys... | 11,002 |
qemu | 2e6fc7eb1a4af1b127df5f07b8bb28af891946fa | 0 | static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
{
return bdrv_get_info(bs->file->bs, bdi);
}
| 11,003 |
qemu | f53a829bb9ef14be800556cbc02d8b20fc1050a7 | 0 | static int nbd_co_writev_1(NbdClientSession *client, int64_t sector_num,
int nb_sectors, QEMUIOVector *qiov,
int offset)
{
struct nbd_request request = { .type = NBD_CMD_WRITE };
struct nbd_reply reply;
ssize_t ret;
if (!bdrv_enable_write_ca... | 11,004 |
qemu | ef76dc59fa5203d146a2acf85a0ad5a5971a4824 | 0 | START_TEST(simple_whitespace)
{
int i;
struct {
const char *encoded;
LiteralQObject decoded;
} test_cases[] = {
{
.encoded = " [ 43 , 42 ]",
.decoded = QLIT_QLIST(((LiteralQObject[]){
QLIT_QINT(43),
QL... | 11,005 |
qemu | 0c16c056a4f9dec18fdd56feec82a5db9ff3c15e | 0 | gboolean qcrypto_hash_supports(QCryptoHashAlgorithm alg)
{
if (alg < G_N_ELEMENTS(qcrypto_hash_alg_map)) {
return true;
}
return false;
}
| 11,007 |
qemu | 5255fcf8e47acd059e2f0d414841c40231c1bd22 | 0 | static int nvic_pending_prio(NVICState *s)
{
/* return the priority of the current pending interrupt,
* or NVIC_NOEXC_PRIO if no interrupt is pending
*/
return s->vectpending ? s->vectors[s->vectpending].prio : NVIC_NOEXC_PRIO;
}
| 11,008 |
qemu | d46636b88339ecc2cb8d10113f45ada164817773 | 0 | static uint64_t pci_config_get_pref_base(PCIDevice *d,
uint32_t base, uint32_t upper)
{
uint64_t val;
val = ((uint64_t)pci_get_word(d->config + base) &
PCI_PREF_RANGE_MASK) << 16;
val |= (uint64_t)pci_get_long(d->config + upper) << 32;
return va... | 11,009 |
qemu | 54d50be688aba80e0fd5ba53f23a074a0ce2e381 | 0 | static void qmp_output_type_enum(Visitor *v, int *obj, const char *strings[],
const char *kind, const char *name,
Error **errp)
{
int i = 0;
int value = *obj;
char *enum_str;
assert(strings);
while (strings[i++] != NULL);
... | 11,010 |
FFmpeg | 0276b9524294e518cdc7cbfa12b7cb301ed86fb6 | 0 | static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
char color_parameter_type[5] = { 0 };
int color_primaries, color_trc, color_matrix;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams - 1];
avio_read(pb, color_para... | 11,011 |
qemu | 936532a4928ce6c95de5718974f6c987aaad7b68 | 0 | static int v9fs_complete_rename(V9fsState *s, V9fsRenameState *vs)
{
int err = 0;
char *old_name, *new_name;
char *end;
if (vs->newdirfid != -1) {
V9fsFidState *dirfidp;
dirfidp = lookup_fid(s, vs->newdirfid);
if (dirfidp == NULL) {
err = -ENOENT;
... | 11,012 |
qemu | 0e9b9edae7bebfd31fdbead4ccbbce03876a7edd | 0 | build_srat(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)
{
AcpiSystemResourceAffinityTable *srat;
AcpiSratProcessorGiccAffinity *core;
AcpiSratMemoryAffinity *numamem;
int i, j, srat_start;
uint64_t mem_base;
uint32_t *cpu_node = g_malloc0(guest_info->smp_cpus * sizeof(ui... | 11,013 |
qemu | eabb7b91b36b202b4dac2df2d59d698e3aff197a | 0 | static void tcg_out_ri64(TCGContext *s, int const_arg, TCGArg arg)
{
if (const_arg) {
assert(const_arg == 1);
tcg_out8(s, TCG_CONST);
tcg_out64(s, arg);
} else {
tcg_out_r(s, arg);
}
}
| 11,014 |
qemu | bec1631100323fac0900aea71043d5c4e22fc2fa | 0 | static void tgen_compare_branch(TCGContext *s, S390Opcode opc, int cc,
TCGReg r1, TCGReg r2, int labelno)
{
TCGLabel* l = &s->labels[labelno];
intptr_t off;
if (l->has_value) {
off = l->u.value_ptr - s->code_ptr;
} else {
/* We need to keep the o... | 11,015 |
qemu | a83000f5e3fac30a7f213af1ba6a8f827622854d | 0 | void spapr_iommu_init(void)
{
QLIST_INIT(&spapr_tce_tables);
/* hcall-tce */
spapr_register_hypercall(H_PUT_TCE, h_put_tce);
}
| 11,017 |
qemu | 4295e15aa730a95003a3639d6dad2eb1e65a59e2 | 0 | static void migration_state_notifier(Notifier *notifier, void *data)
{
MigrationState *s = data;
if (migration_is_active(s)) {
#ifdef SPICE_INTERFACE_MIGRATION
spice_server_migrate_start(spice_server);
#endif
} else if (migration_has_finished(s)) {
#if SPICE_SERVER_VERSION >= 0x000701 /* 0... | 11,018 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static inline void downmix_3f_1r_to_stereo(float *samples)
{
int i;
for (i = 0; i < 256; i++) {
samples[i] += (samples[i + 256] + samples[i + 768]);
samples[i + 256] += (samples[i + 512] + samples[i + 768]);
samples[i + 512] = samples[i + 768] = 0;
}
}
| 11,020 |
FFmpeg | 4ce03a95e27d618a2c65b1ed134a72b48bbbff00 | 0 | static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) {
AVIOContext *pb = s->pb;
int ret;
unsigned int frame_type, packet_size, padding, frame_size;
avio_rb16(pb); /* channel number */
frame_type = avio_rb16(pb);
packet_size = avio_rb32(pb);
padding ... | 11,021 |
FFmpeg | f2960097e42ddf9a356bab6547f87906f6999e0a | 0 | static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
{
BinkContext * const c = avctx->priv_data;
GetBitContext gb;
int plane, plane_idx, ret;
int bits_count = pkt->size << 3;
if (c->version > 'b') {
if(c->pic->data[0])
avctx->release... | 11,022 |
FFmpeg | 91f4a44ff4fa55e0a48f71c432a1dc3158d662b9 | 0 | static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],
int srcStride[], int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[])
{
int i, j, p;
for (p = 0; p < 4; p++) {
int srcstr = srcStride[p] >> 1;
int dst... | 11,024 |
FFmpeg | b853cfe7eaf13b7d4ff3ceba7098544ccc049df8 | 0 | static void video_refresh(void *opaque)
{
VideoState *is = opaque;
VideoPicture *vp;
double time;
SubPicture *sp, *sp2;
if (!is->paused && get_master_sync_type(is) == AV_SYNC_EXTERNAL_CLOCK && is->realtime)
check_external_clock_speed(is);
if (!display_disable && is->show_mo... | 11,025 |
FFmpeg | d2a25c4032ce6ceabb0f51b5c1e6ca865395a793 | 0 | static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbuf)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt);
FrameBuffer *buf;
int i, ret;
int pixel_size;
int h_chroma_shift, v_chroma_shift;
int edge = 32; // XXX should be avcodec_get_edge_width()... | 11,028 |
FFmpeg | 2758cdedfb7ac61f8b5e4861f99218b6fd43491d | 0 | URLProtocol *ffurl_protocol_next(const URLProtocol *prev)
{
return prev ? prev->next : first_protocol;
}
| 11,029 |
FFmpeg | a2b7ed3274b2b575f6d2e8fd3bf0a6a1818b2c1e | 0 | static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
{
int tag = track->enc->codec_tag;
if (!tag || (track->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL &&
(tag == MKTAG('d','v','c','p') ||
track->enc->codec_id == CODEC_ID_RAWVIDEO ||
... | 11,030 |
FFmpeg | 8de3458a07376b0a96772e586b6dba5e93432f52 | 0 | static av_cold int nvenc_recalc_surfaces(AVCodecContext *avctx)
{
NvencContext *ctx = avctx->priv_data;
int nb_surfaces = 0;
if (ctx->rc_lookahead > 0) {
nb_surfaces = ctx->rc_lookahead + ((ctx->encode_config.frameIntervalP > 0) ? ctx->encode_config.frameIntervalP : 0) + 1 + 4;
if (c... | 11,031 |
FFmpeg | 7cf22c79706d23d40d16cee37eb32d5797adcc2c | 0 | yuv2rgba64_full_2_c_template(SwsContext *c, const int32_t *buf[2],
const int32_t *ubuf[2], const int32_t *vbuf[2],
const int32_t *abuf[2], uint16_t *dest, int dstW,
int yalpha, int uvalpha, int y,
enum AVPixelFormat target, ... | 11,032 |
FFmpeg | f0ff9eb49394d4ba06eff30e0dac2f3ce590e311 | 0 | static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
{
if(st->codec->codec_id == CODEC_ID_PROBE){
AVProbeData *pd = &st->probe_data;
av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);
--st->probe_packets;
pd->buf = av_realloc(pd->buf, pd->buf... | 11,033 |
FFmpeg | 99683a307776a7638ccce236a4ce5aa3e914e77d | 1 | static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_number)
{
int vo_ver_id;
if(s->max_b_frames || s->quarter_sample){
vo_ver_id= 5;
s->vo_type= ADV_SIMPLE_VO_TYPE;
}else{
vo_ver_id= 1;
s->vo_type= SIMPLE_VO_TYPE;
}
put_bits(&s... | 11,034 |
qemu | 5f81724d80a1492c73d329242663962139db739b | 1 | static void ide_atapi_cmd_read_pio(IDEState *s, int lba, int nb_sectors,
int sector_size)
{
s->lba = lba;
s->packet_transfer_size = nb_sectors * sector_size;
s->elementary_transfer_size = 0;
s->io_buffer_index = sector_size;
s->cd_sector_size = sector_size;
... | 11,035 |
FFmpeg | 26227d91865ddfbfe35c9ff84853cc469e1c7daf | 1 | static inline int *DEC_UPAIR(int *dst, unsigned idx, unsigned sign)
{
dst[0] = (idx & 15) * (1 - (sign & 0xFFFFFFFE));
dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) << 1));
return dst + 2;
}
| 11,036 |
FFmpeg | a625e13208ad0ebf1554aa73c9bf41452520f176 | 0 | static void av_always_inline filter_mb_edgech( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) {
const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;
const int alpha = alpha_table[index_a];
con... | 11,037 |
qemu | 4f4321c11ff6e98583846bfd6f0e81954924b003 | 1 | static void usbredir_configuration_status(void *priv, uint32_t id,
struct usb_redir_configuration_status_header *config_status)
{
USBRedirDevice *dev = priv;
AsyncURB *aurb;
int len = 0;
DPRINTF("set config status %d config %d id %u\n", config_status->status,
config_status->conf... | 11,038 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static void gen_smul_dual(TCGv a, TCGv b)
{
TCGv tmp1 = new_tmp();
TCGv tmp2 = new_tmp();
tcg_gen_ext16s_i32(tmp1, a);
tcg_gen_ext16s_i32(tmp2, b);
tcg_gen_mul_i32(tmp1, tmp1, tmp2);
dead_tmp(tmp2);
tcg_gen_sari_i32(a, a, 16);
tcg_gen_sari_i32(b, b, 16);
tcg_gen_mul_i32(b, ... | 11,039 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static int ac3_parse_bsi(AC3DecodeContext *ctx)
{
ac3_bsi *bsi = &ctx->bsi;
uint32_t *flags = &bsi->flags;
GetBitContext *gb = &ctx->gb;
*flags = 0;
bsi->cmixlev = 0;
bsi->surmixlev = 0;
bsi->dsurmod = 0;
bsi->bsid = get_bits(gb, 5);
if (bsi->bsid > 0x08)
retur... | 11,040 |
FFmpeg | a38469e1da7b4829a2fba4279d8420a33f96832e | 0 | int av_grab(AVFormatContext *s)
{
UINT8 audio_buf[AUDIO_FIFO_SIZE];
UINT8 audio_buf1[AUDIO_FIFO_SIZE];
UINT8 audio_out[AUDIO_FIFO_SIZE];
UINT8 video_buffer[1024*1024];
char buf[256];
short *samples;
URLContext *audio_handle = NULL, *video_handle = NULL;
int ret;
AVCodecCont... | 11,041 |
qemu | f67409a5bb43ebe74401fa8e187267eb0f139293 | 1 | static int64_t nfs_client_open(NFSClient *client, QDict *options,
int flags, Error **errp, int open_flags)
{
int ret = -EINVAL;
QemuOpts *opts = NULL;
Error *local_err = NULL;
struct stat st;
char *file = NULL, *strp = NULL;
opts = qemu_opts_create(&runti... | 11,042 |
FFmpeg | 4b35ee0b7c0c4cbac3541a25a5e8c00b657c8f95 | 1 | void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band,
IVITile *tile, int32_t mv_scale)
{
int x, y, need_mc, mbn, blk, num_blocks, mv_x, mv_y, mc_type;
int offs, mb_offset, row_offset;
IVIMbInfo *mb, *ref_mb;
const int1... | 11,043 |
FFmpeg | 330deb75923675224fb9aed311d3d6ce3ec52420 | 1 | static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base){
int y_size = s->b8_stride * (2 * s->mb_height + 1);
int c_size = s->mb_stride * (s->mb_height + 1);
int yc_size = y_size + 2 * c_size;
int i;
// edge emu needs blocksize + filter length - 1 (=17x17 for halfpel / 21x21... | 11,044 |
FFmpeg | 754f84663e8b3a88fa2e953b195d59230393fb8d | 1 | static int msrle_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MsrleContext *s = avctx->priv_data;
int istride = FFALIGN(avctx->width*avctx->bits... | 11,045 |
FFmpeg | 54ea773614e6dd43e31f870cde969d762f2deba6 | 1 | static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat, int dstFormat,
int srcW, int srcH, int dstW, int dstH, int flags){
uint8_t *src[3];
uint8_t *dst[3];
uint8_t *out[3];
int srcStride[3], dstStride[3];
int i;
uint64_t ssdY, ssdU, ssdV;
... | 11,047 |
qemu | 7fc5b13fd7b05babc7bcad9dcb8281ae202a9494 | 1 | static int qemu_rdma_resolve_host(RDMAContext *rdma, Error **errp)
{
int ret;
struct addrinfo *res;
char port_str[16];
struct rdma_cm_event *cm_event;
char ip[40] = "unknown";
struct addrinfo *e;
if (rdma->host == NULL || !strcmp(rdma->host, "")) {
ERROR(errp, "RDMA hostna... | 11,048 |
qemu | bb160b571fe469b03228d4502c75a18045978a74 | 1 | static NetSocketState *net_socket_fd_init_dgram(NetClientState *peer,
const char *model,
const char *name,
int fd, int is_connected,
... | 11,049 |
FFmpeg | 2caf19e90f270abe1e80a3e85acaf0eb5c9d0aac | 1 | static void FUNCC(pred4x4_horizontal)(uint8_t *_src, const uint8_t *topright, int _stride){
pixel *src = (pixel*)_src;
int stride = _stride/sizeof(pixel);
((pixel4*)(src+0*stride))[0]= PIXEL_SPLAT_X4(src[-1+0*stride]);
((pixel4*)(src+1*stride))[0]= PIXEL_SPLAT_X4(src[-1+1*stride]);
((pixel4*)(s... | 11,050 |
qemu | e654887f3880fb0f6d4d40d15d2977de245a6440 | 1 | static void ehci_trace_itd(EHCIState *s, target_phys_addr_t addr, EHCIitd *itd)
{
trace_usb_ehci_itd(addr, itd->next);
}
| 11,051 |
FFmpeg | f9d8658d67cfb478e5e36ce1d2795eabdb201bcb | 1 | static inline void horizX1Filter(uint8_t *src, int stride, int QP)
{
int y;
static uint64_t *lut= NULL;
if(lut==NULL)
{
int i;
lut = av_malloc(256*8);
for(i=0; i<256; i++)
{
int v= i < 128 ? 2*i : 2*(i-256);
/*
//Simulate 112242211 9-Tap filter
... | 11,052 |
FFmpeg | 85ff33948963257d418abe7d8975b4c9c4641223 | 0 | AVCodecParserContext *av_parser_init(int codec_id)
{
AVCodecParserContext *s;
AVCodecParser *parser;
int ret;
if(codec_id == CODEC_ID_NONE)
return NULL;
for(parser = av_first_parser; parser != NULL; parser = parser->next) {
if (parser->codec_ids[0] == codec_id ||
... | 11,053 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | int migrate_use_xbzrle(void)
{
MigrationState *s;
s = migrate_get_current();
return s->enabled_capabilities[MIGRATION_CAPABILITY_XBZRLE];
}
| 11,054 |
qemu | 3996e85c1822e05c50250f8d2d1e57b6bea1229d | 1 | static void xen_hvm_change_state_handler(void *opaque, int running,
RunState rstate)
{
if (running) {
xen_main_loop_prepare((XenIOState *)opaque);
}
}
| 11,056 |
qemu | 5cb9b56acfc0b50acf7ccd2d044ab4991c47fdde | 1 | static int parse_vlan(DeviceState *dev, Property *prop, const char *str)
{
VLANState **ptr = qdev_get_prop_ptr(dev, prop);
int id;
if (sscanf(str, "%d", &id) != 1)
return -EINVAL;
*ptr = qemu_find_vlan(id, 1);
if (*ptr == NULL)
return -ENOENT;
return 0;
}
| 11,057 |
FFmpeg | de64d8cf171c6ecdca22d57f0bdd7efec95d0c0e | 1 | static int qtrle_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
QtrleContext *s = avctx->priv_data;
int header, start_line;
int stream... | 11,058 |
FFmpeg | 933aa91e31d5cbf9dbc0cf416a988e6011bc4a40 | 1 | static void cabac_init_decoder(HEVCContext *s)
{
GetBitContext *gb = &s->HEVClc->gb;
skip_bits(gb, 1);
align_get_bits(gb);
ff_init_cabac_decoder(&s->HEVClc->cc,
gb->buffer + get_bits_count(gb) / 8,
(get_bits_left(gb) + 7) / 8);
}
| 11,059 |
FFmpeg | 61d158c321a82ec7bfc46ce480997797e8048b85 | 1 | static void swap_sample_fmts_on_filter(AVFilterContext *filter)
{
AVFilterLink *link = NULL;
int format, bps;
int i, j;
for (i = 0; i < filter->nb_inputs; i++) {
link = filter->inputs[i];
if (link->type == AVMEDIA_TYPE_AUDIO &&
link->out_formats->format_count == 1... | 11,060 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | int bdrv_drop_intermediate(BlockDriverState *active, BlockDriverState *top,
BlockDriverState *base, const char *backing_file_str)
{
BlockDriverState *intermediate;
BlockDriverState *base_bs = NULL;
BlockDriverState *new_top_bs = NULL;
BlkIntermediateStates *intermediate_... | 11,061 |
FFmpeg | 0ccddbad200c1d9439c5a836501917d515cddf76 | 1 | static int smacker_decode_bigtree(BitstreamContext *bc, HuffContext *hc,
DBCtx *ctx)
{
if (hc->current + 1 >= hc->length) {
av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n");
return AVERROR_INVALIDDATA;
}
if (!bitstream_read_bit(bc)) { // Leaf
... | 11,062 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int qtrle_encode_end(AVCodecContext *avctx)
{
QtrleEncContext *s = avctx->priv_data;
av_frame_free(&avctx->coded_frame);
avpicture_free(&s->previous_frame);
av_free(s->rlecode_table);
av_free(s->length_table);
av_free(s->skip_table);
return 0;
}
| 11,063 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int pcx_encode_init(AVCodecContext *avctx)
{
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
return 0;
}
| 11,064 |
FFmpeg | 9759d2b886057b90355716edb23262e17f9bc3f9 | 0 | static int decode_mb_info(IVI4DecContext *ctx, IVIBandDesc *band,
IVITile *tile, AVCodecContext *avctx)
{
int x, y, mv_x, mv_y, mv_delta, offs, mb_offset, blks_per_mb,
mv_scale, mb_type_bits;
IVIMbInfo *mb, *ref_mb;
int row_offset = band->mb_... | 11,065 |
FFmpeg | 1c088632e98af96f9cbe8129c5d7eb7274f8d4ed | 0 | static void hevc_parser_close(AVCodecParserContext *s)
{
HEVCParserContext *ctx = s->priv_data;
int i;
#if ADVANCED_PARSER
HEVCContext *h = &ctx->h;
for (i = 0; i < FF_ARRAY_ELEMS(h->ps.vps_list); i++)
av_buffer_unref(&h->ps.vps_list[i]);
for (i = 0; i < FF_ARRAY_ELEMS(h->ps.sp... | 11,067 |
FFmpeg | 26c0cc154e06cb0064b3a3da49447ac44d82444f | 1 | static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
{
MvContext *mv = avctx->priv_data;
AVIOContext *pb = avctx->pb;
AVStream *st = avctx->streams[mv->stream_index];
const AVIndexEntry *index;
int frame = mv->frame[mv->stream_index];
int ret;
uint64_t pos;
if (fra... | 11,068 |
FFmpeg | d9f4dc52a0fe3edb93f153cf13e750f7c46243d1 | 1 | static av_cold int prores_encode_close(AVCodecContext *avctx)
{
ProresContext* ctx = avctx->priv_data;
av_freep(&avctx->coded_frame);
av_free(ctx->fill_y);
av_free(ctx->fill_u);
av_free(ctx->fill_v);
return 0;
}
| 11,071 |
FFmpeg | 8fbab7a6c84fd75de4f752b412cea8032604f75b | 1 | int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd,
AVIOContext *avio)
{
int len, need_keyframe, missing_packets;
AVIOContext *pb;
uint8_t *buf;
int64_t now;
uint16_t first_missing, missing_mask;
if (!fd && !avio)
return -1;
n... | 11,072 |
qemu | 2296f194dfde4c0a54f249d3fdb8c8ca21dc611b | 1 | static struct pathelem *add_entry(struct pathelem *root, const char *name)
{
root->num_entries++;
root = realloc(root, sizeof(*root)
+ sizeof(root->entries[0])*root->num_entries);
root->entries[root->num_entries-1] = new_entry(root->pathname, root, name);
root->entries[root-... | 11,073 |
FFmpeg | 9487fb4dea3498eb4711eb023f43199f68701b1e | 1 | yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf[2], uint8_t *dest, int dstW,
int yalpha, int uvalpha, int y,
enum PixelFormat target, int hasAlpha)
{
con... | 11,074 |
qemu | 0b8b8753e4d94901627b3e86431230f2319215c4 | 1 | static void nbd_recv_coroutines_enter_all(NbdClientSession *s)
{
int i;
for (i = 0; i < MAX_NBD_REQUESTS; i++) {
if (s->recv_coroutine[i]) {
qemu_coroutine_enter(s->recv_coroutine[i], NULL);
}
}
}
| 11,076 |
FFmpeg | 8bedbb82cee4463a43e60eb22674c8bf927280ef | 1 | static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
Jpeg2000Component *comp,
Jpeg2000T1Context *t1, Jpeg2000Band *band)
{
int i, j, idx;
int32_t *datap =
(int32_t *) &comp->data[(comp->coord[0][1] - comp->coord[0][0]) * y +... | 11,077 |
qemu | f53c398aa603cea135ee58fd15249aeff7b9c7ea | 1 | static void ehci_queues_rip_device(EHCIState *ehci, USBDevice *dev)
{
EHCIQueue *q, *tmp;
QTAILQ_FOREACH_SAFE(q, &ehci->queues, next, tmp) {
if (q->packet.owner == NULL ||
q->packet.owner->dev != dev) {
continue;
}
ehci_free_queue(q);
}
}
| 11,078 |
qemu | 96adc5c7c2178d02f0db2db368ba3e4aacef931a | 1 | static int vfio_add_std_cap(VFIODevice *vdev, uint8_t pos)
{
PCIDevice *pdev = &vdev->pdev;
uint8_t cap_id, next, size;
int ret;
cap_id = pdev->config[pos];
next = pdev->config[pos + 1];
/*
* If it becomes important to configure capabilities to their actual
* size, use thi... | 11,079 |
FFmpeg | dcc39ee10e82833ce24aa57926c00ffeb1948198 | 0 | void ff_xvmc_decode_mb(MpegEncContext *s)
{
XvMCMacroBlock *mv_block;
struct xvmc_pix_fmt *render;
int i, cbp, blocks_per_mb;
const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
if (s->encoding) {
av_log(s->avctx, AV_LOG_ERROR, "XVMC doesn't support encoding!!!\n");
ret... | 11,081 |
FFmpeg | 80137531139588774e048d6e1dae34ab5cbbbfa2 | 0 | static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
MOVStreamContext *sc;
int i, edit_count, version;
if (c->fc->nb_streams < 1 || c->ignore_editlist)
return 0;
sc = c->fc->streams[c->fc->nb_streams-1]->priv_data;
version = avio_r8(pb); /* version */
avio... | 11,082 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.